Socket socket = null;
try
{
socket = _serverSocket.accept();
ProtocolEngine engine = _factory.newProtocolEngine(socket.getRemoteSocketAddress());
if(engine != null)
{
socket.setTcpNoDelay(_config.getTcpNoDelay());
socket.setSoTimeout(1000 * HANSHAKE_TIMEOUT);
final Integer sendBufferSize = _config.getSendBufferSize();
final Integer receiveBufferSize = _config.getReceiveBufferSize();
socket.setSendBufferSize(sendBufferSize);
socket.setReceiveBufferSize(receiveBufferSize);
final IdleTimeoutTicker ticker = new IdleTimeoutTicker(engine, TIMEOUT);
NetworkConnection connection =
new IoNetworkConnection(socket, engine, sendBufferSize, receiveBufferSize, _timeout,
ticker);
connection.setMaxReadIdle(HANSHAKE_TIMEOUT);
ticker.setConnection(connection);
engine.setNetworkConnection(connection, connection.getSender());
connection.start();
}
else
{