public bool ReceiveMessage()
{
try
{
if (_socket.Poll(TimeSpan.FromSeconds(0)))
return true;
}
catch (OperationCanceledException)
{
Log.Info("[TcpGateway] Cancellation signal received...exiting");
throw;
}
catch (TerminatingException)
{
Log.Info("[TcpGateway] Context terminated...exiting");
throw;
}
catch (Exception e)
{
Log.Warn("[TcpGateway] Error from mainloop...exiting", e);
throw;
}
return false;
}