|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NonblockingSocketChannel
Interface encapsulating the SocketChannel to provide the necessary
non-blocking Socket operations.
| Method Summary | |
|---|---|
void |
close()
Closes the underlying SocketChannel. |
InetSocketAddress |
getLocalAddress()
Obtains the local address for this NonblockingSocketChannel. |
InetSocketAddress |
getRemoteAddress()
Obtains the remote address to which this NonblockingSocketChannel
is connected. |
int |
read(ByteBuffer buffer)
Reads data from the SocketChannel. |
SelectionKey |
register(Selector selector,
int ops,
Object attachment)
Registers the underlying SocketChannel with the input
Selector. |
int |
write(ByteBuffer data)
Writes the data to the SocketChannel. |
| Method Detail |
|---|
SelectionKey register(Selector selector,
int ops,
Object attachment)
throws IOException
SocketChannel with the input
Selector.
selector - Selector.ops - Operations as per SelectionKey.interestOps().attachment - Attachment for the SelectionKey.
SelectionKey of the resulting registration.
IOException - If fails to register.InetSocketAddress getLocalAddress()
NonblockingSocketChannel.
NonblockingSocketChannel.InetSocketAddress getRemoteAddress()
NonblockingSocketChannel
is connected.
NonblockingSocketChannel is
connected.
int read(ByteBuffer buffer)
throws IOException
SocketChannel.
buffer - ByteBuffer to write data.
IOException - If fails to read.
int write(ByteBuffer data)
throws IOException
SocketChannel.
data - ByteBuffer with the data to write.
IOException - If fails to write.
void close()
throws IOException
SocketChannel.
IOException - If fails to close.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||