ssc.socket().setReuseAddress( cfg.isReuseAddress() );
ssc.socket().setReceiveBufferSize(
( ( SocketSessionConfig ) cfg.getSessionConfig() ).getReceiveBufferSize() );
// and bind.
ssc.socket().bind( req.address, cfg.getBacklog() );
if( req.address == null || req.address.getPort() == 0 )
{
req.address = ( InetSocketAddress ) ssc.socket().getLocalSocketAddress();
}
ssc.register( selector, SelectionKey.OP_ACCEPT, req );