use of tezc.base.transport.sock.Sock in project tezcRaft by tezc.
the class IOWorker method handleAcceptEvent.
/**
* New connection arrived
*
* @param listener Listener object which has accepted the connection
*/
@Override
public void handleAcceptEvent(Listener listener) {
Sock sock;
try {
sock = listener.accept();
} catch (Exception e) {
logError(e);
return;
}
try {
logInfo(listener.toString(), " accepted : ", sock);
sock.register(poll.getSelector(), SelectionKey.OP_READ);
sock.handshake();
} catch (Exception e) {
sock.close();
logInfo("Disconnected : ", sock.toString());
return;
}
pendings.add(new Connection(this, sock, null));
}
Aggregations