try{
new ProtocolDecoderInitial(
transport,
shared_secrets,
!is_incoming,
initial_data,
new ProtocolDecoderAdapter()
{
public int
getMaximumPlainHeaderLength()
{
return( listener.getMaximumPlainHeaderLength());
}
public int
matchPlainHeader(
ByteBuffer buffer )
{
return( listener.matchPlainHeader( buffer ));
}
public void
gotSecret(
byte[] session_secret )
{
listener.gotSecret( session_secret );
}
public void
decodeComplete(
ProtocolDecoder decoder,
ByteBuffer remaining_initial_data )
{
listener.handshakeSuccess( decoder, remaining_initial_data );
}
public void
decodeFailed(
ProtocolDecoder decoder,
Throwable cause )
{
listener.handshakeFailure( cause );
}
});
}catch( Throwable e ){
listener.handshakeFailure( e );
}