| Modifier and Type | Field and Description |
|---|---|
| private ApplicationBufferHandler | |
| protected final SocketBufferHandler | |
| pack-priv static final NioChannel | |
| protected static final ByteBuffer | |
| protected SocketChannel | |
| protected static final StringManager | |
| protected NioEndpoint. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | checkInterruptStatus()
This method should be used to check the interrupt status before attempting a write. |
| public void | |
| public void | |
| public boolean | Returns: Always returnsfalse for non-secure channelReturn true if the buffer wrote data. |
| public void | |
| protected ApplicationBufferHandler | |
| public SocketBufferHandler | |
| public SocketChannel | |
| public int | |
| pack-priv NioEndpoint. | |
| public int | Returns: Always returns zeroUnused in non-secure implementation read, boolean Unused in non-secure implementation write)Performs SSL handshake hence is a no-op for the non-secure implementation. |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if, and only if, this channel is openImplements java. Tells whether or not this channel is open. |
| public int | Returns: The number of bytes read, possibly zero, or-1 if
the channel has reached end-of-streamThe buffer into which bytes are to be transferred dst)Implements java. Reads a sequence of bytes from this channel into the given buffer. |
| public long | read(ByteBuffer[]
The buffers into which bytes are to be transferred dsts)Implements java. Reads a sequence of bytes from this channel into the given buffers. |
| public long | read(ByteBuffer[]
The buffers into which bytes are to be transferred dsts, int The offset within the buffer array of the first buffer into
which bytes are to be transferred; must be non-negative and no
larger than offset, int dsts.lengthThe maximum number of buffers to be accessed; must be
non-negative and no larger than
length)dsts.length - offsetImplements java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. |
| public void | reset(SocketChannel
the socket channel channel, NioEndpoint.the socket wrapper socketWrapperReset the channel |
| public void | |
| public String | |
| public int | Returns: The number of bytes written, possibly zeroThe buffer from which bytes are to be retrieved src)Implements java. Writes a sequence of bytes to this channel from the given buffer. |
| public long | write(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs)Implements java. Writes a sequence of bytes to this channel from the given buffers. |
| public long | write(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than offset, int srcs.lengthThe maximum number of buffers to be accessed; must be
non-negative and no larger than
length)srcs.length - offsetImplements java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. |
| appReadBufHandler | back to summary |
|---|---|
| private ApplicationBufferHandler appReadBufHandler | |
| bufHandler | back to summary |
|---|---|
| protected final SocketBufferHandler bufHandler | |
| CLOSED_NIO_CHANNEL | back to summary |
|---|---|
| pack-priv static final NioChannel CLOSED_NIO_CHANNEL | |
| emptyBuf | back to summary |
|---|---|
| protected static final ByteBuffer emptyBuf | |
| sc | back to summary |
|---|---|
| protected SocketChannel sc | |
| sm | back to summary |
|---|---|
| protected static final StringManager sm | |
| socketWrapper | back to summary |
|---|---|
| protected NioEndpoint. | |
| NioChannel | back to summary |
|---|---|
| public NioChannel(SocketBufferHandler bufHandler) | |
| checkInterruptStatus | back to summary |
|---|---|
| protected void checkInterruptStatus() throws IOException This method should be used to check the interrupt status before attempting a write. If a thread has been interrupted and the interrupt has not been cleared then an attempt to write to the socket will fail. When this happens the socket is removed from the poller without the socket being selected. This results in a connection limit leak for NIO as the endpoint expects the socket to be selected even in error conditions.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Closes this channel.
| |
| close | back to summary |
|---|---|
| public void close(boolean force) throws IOException Close the connection.
| |
| flushOutbound | back to summary |
|---|---|
| public boolean flushOutbound() throws IOException Return true if the buffer wrote data. NO-OP for non-secure channel.
| |
| free | back to summary |
|---|---|
| public void free() Free the channel memory | |
| getAppReadBufHandler | back to summary |
|---|---|
| protected ApplicationBufferHandler getAppReadBufHandler() | |
| getBufHandler | back to summary |
|---|---|
| public SocketBufferHandler getBufHandler() | |
| getIOChannel | back to summary |
|---|---|
| public SocketChannel getIOChannel() | |
| getOutboundRemaining | back to summary |
|---|---|
| public int getOutboundRemaining() | |
| getSocketWrapper | back to summary |
|---|---|
pack-priv NioEndpoint.
| |
| handshake | back to summary |
|---|---|
| public int handshake(boolean read, boolean write) throws IOException Performs SSL handshake hence is a no-op for the non-secure implementation.
| |
| isClosing | back to summary |
|---|---|
| public boolean isClosing() | |
| isHandshakeComplete | back to summary |
|---|---|
| public boolean isHandshakeComplete() | |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements java. Tells whether or not this channel is open.
| |
| read | back to summary |
|---|---|
| public int read(ByteBuffer dst) throws IOException Implements java. Reads a sequence of bytes from this channel into the given buffer.
| |
| read | back to summary |
|---|---|
| public long read(ByteBuffer[] dsts) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into the given buffers. An invocation of this method of the form c.read(dsts, 0, dsts.length);
| |
| read | back to summary |
|---|---|
| public long read(ByteBuffer[] dsts, int offset, int length) throws IOException Implements java. Doc from java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. An invocation of this method attempts to read up to r bytes from this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is, dsts[offset].remaining() + dsts[offset+1].remaining() + ... + dsts[offset+length-1].remaining() Suppose that a byte sequence of length n is read, where
This method may be invoked at any time. If another thread has already initiated a read operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| reset | back to summary |
|---|---|
| public void reset(SocketChannel channel, NioEndpoint. Reset the channel
| |
| setAppReadBufHandler | back to summary |
|---|---|
| public void setAppReadBufHandler(ApplicationBufferHandler handler) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Implements java. Writes a sequence of bytes to this channel from the given buffer.
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffers. An invocation of this method of the form c.write(srcs, 0, srcs.length);
| |
| write | back to summary |
|---|---|
| public long write(ByteBuffer[] srcs, int offset, int length) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. An attempt is made to write up to r bytes to this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is, srcs[offset].remaining() + srcs[offset+1].remaining() + ... + srcs[offset+length-1].remaining() Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |