Java Examples for fm.liu.timo.net.connection.AbstractConnection
The following java examples will help you to understand the usage of fm.liu.timo.net.connection.AbstractConnection. These source code samples are taken from different open source projects.
Example 1
| Project: Timo-master File: NIOConnector.java View source code |
private void connect(Selector selector) {
AbstractConnection c = null;
while ((c = connectQueue.poll()) != null) {
try {
SocketChannel channel = (SocketChannel) c.getChannel();
channel.register(selector, SelectionKey.OP_CONNECT, c);
channel.connect(new InetSocketAddress(c.getHost(), c.getPort()));
} catch (Throwable e) {
c.close(e.getMessage());
}
}
}