protected override void OnCommand(ITransport sender, Command command)
{
commandReceived.Value = true;
inRead.Value = true;
try
{
if(command.IsKeepAliveInfo)
{
KeepAliveInfo info = command as KeepAliveInfo;
if(info.ResponseRequired)
{
try
{
info.ResponseRequired = false;
Oneway(info);
}
catch(IOException ex)
{
OnException(this, ex);
}
}
}
else if(command.IsWireFormatInfo)
{
lock(monitor)
{
remoteWireFormatInfo = command as WireFormatInfo;
try
{
StartMonitorThreads();
}
catch(IOException ex)
{
OnException(this, ex);
}
}
}
base.OnCommand(sender, command);
}
finally
{
inRead.Value = false;
}
}