/** * register with the selection and connect * @param sock the {@link SocketChannel} * @param addr the address of remote host * @throws IOException */ void registerAndConnect(SocketChannel sock, InetSocketAddress addr) throws IOException { sockKey = sock.register(selector, SelectionKey.OP_CONNECT); boolean immediateConnect = sock.connect(addr); if (immediateConnect) { sendThread.primeConnection(); } }
incomingBuffer = lenBuffer; sendThread.primeConnection(); updateNow(); updateLastSendAndHeard();
/** * register with the selection and connect * @param sock the {@link SocketChannel} * @param addr the address of remote host * @throws IOException */ void registerAndConnect(SocketChannel sock, InetSocketAddress addr) throws IOException { sockKey = sock.register(selector, SelectionKey.OP_CONNECT); boolean immediateConnect = sock.connect(addr); if (immediateConnect) { sendThread.primeConnection(); } }
lastHeard = now; lastSend = now; primeConnection(k);
sockKey = sock.register(selector, SelectionKey.OP_CONNECT); if (sock.connect(addr)) { primeConnection(sockKey);
if (sc.finishConnect()) { updateLastSendAndHeard(); sendThread.primeConnection();
updateLastSendAndHeard(); updateSocketAddresses(); sendThread.primeConnection();