public void messageReceived(final NextFilter nextFilter,final IoBuffer buf){
  try {
    if (buf.remaining() >= SocksProxyConstants.SOCKS_4_RESPONSE_SIZE) {
      handleResponse(buf);
    }
  }
 catch (  Exception ex) {
    closeSession("Proxy handshake failed: ",ex);
  }
}

public void messageReceived ( final NextFilter nextFilter , final IoBuffer buf ) { try { if ( buf . remaining ( ) >= SocksProxyConstants . SOCKS_4_RESPONSE_SIZE ) { handleResponse ( buf ) ; } } catch ( Exception ex ) { closeSession ( "Proxy handshake failed: " , ex ) ; } }
handle incoming data during the handshake process . should consume only the handshake data from the buffer , leaving any extra data in place .
