Package com.yahoo.io
Interface Connection
-
public interface Connection
Connection interface is the abstraction for an operating asynchronous NIO connection. One is created for each "accept" on the channel.- Author:
- Bob Travis, Bjorn Borud
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Called when the channel should be closed.void
connect()
Called when a socket has completed connecting to its destination.void
read()
Called when the channel can accept a read, and is enabled for readingint
selectOps()
called to get the correct initial SelectionKey operation flags for the next Select cycle, for this channeljava.nio.channels.SocketChannel
socketChannel()
Called to get the SocketChannel for this Connection.void
write()
called when the channel can accept a write, and is enabled for writing
-
-
-
Method Detail
-
write
void write() throws java.io.IOException
called when the channel can accept a write, and is enabled for writing- Throws:
java.io.IOException
-
read
void read() throws java.io.IOException
Called when the channel can accept a read, and is enabled for reading- Throws:
java.io.IOException
-
close
void close() throws java.io.IOException
Called when the channel should be closed.- Throws:
java.io.IOException
-
connect
void connect() throws java.io.IOException
Called when a socket has completed connecting to its destination. (Asynchronous connect)- Throws:
java.io.IOException
-
selectOps
int selectOps()
called to get the correct initial SelectionKey operation flags for the next Select cycle, for this channel
-
socketChannel
java.nio.channels.SocketChannel socketChannel()
Called to get the SocketChannel for this Connection.- Returns:
- Returns the SocketChannel representing this connection
-
-