protected override void OnCommand(ITransport sender, Command command)
{
if ( command.IsWireFormatInfo )
{
WireFormatInfo info = (WireFormatInfo)command;
try
{
if (!info.Valid)
{
throw new IOException("Remote wire format magic is invalid");
}
wireInfoSentDownLatch.await(negotiateTimeout);
wireFormat.RenegotiateWireFormat(info);
}
catch (Exception e)
{
OnException(this, e);
}
finally
{
readyCountDownLatch.countDown();
}
}
this.commandHandler(sender, command);
}