protected final void configureSocketChannel ( SocketChannel sc ) throws IOException { sc . socket ( ) . setSoTimeout ( this . soTimeout ) ; sc . configureBlocking ( false ) ; if ( this . socketOptions . get ( StandardSocketOption . SO_REUSEADDR ) != null ) { sc . socket ( ) . setReuseAddress ( StandardSocketOption . SO_REUSEADDR . type ( ) . cast ( this . socketOptions . get ( StandardSocketOption . SO_REUSEADDR ) ) ) ; } if ( this . socketOptions . get ( StandardSocketOption . SO_SNDBUF ) != null ) { sc . socket ( ) . setSendBufferSize ( StandardSocketOption . SO_SNDBUF . type ( ) . cast ( this . socketOptions . get ( StandardSocketOption . SO_SNDBUF ) ) ) ; } if ( this . socketOptions . get ( StandardSocketOption . SO_KEEPALIVE ) != null ) { sc . socket ( ) . setKeepAlive ( StandardSocketOption . SO_KEEPALIVE . type ( ) . cast ( this . socketOptions . get ( StandardSocketOption . SO_KEEPALIVE ) ) ) ; } if ( this . socketOptions . get ( StandardSocketOption . SO_LINGER ) != null ) { sc . socket ( ) . setSoLinger ( this . soLingerOn , StandardSocketOption . SO_LINGER . type ( ) . cast ( this . socketOptions . get ( StandardSocketOption . SO_LINGER ) ) ) ; } if ( this . socketOptions . get ( StandardSocketOption . SO_RCVBUF ) != null ) { sc . socket ( ) . setReceiveBufferSize ( StandardSocketOption . SO_RCVBUF . type ( ) . cast ( this . socketOptions . get ( StandardSocketOption . SO_RCVBUF ) ) ) ; } if ( this . socketOptions . get ( StandardSocketOption . TCP_NODELAY ) != null ) { sc . socket ( ) . setTcpNoDelay ( StandardSocketOption . TCP_NODELAY . type ( ) . cast ( this . socketOptions . get ( StandardSocketOption . TCP_NODELAY ) ) ) ; } }
Confiure socket channel