void IGatewaySync.Stop(bool stopListenOnly)
{
_logger?.Info($"Stop (StopListenOnly={stopListenOnly})");
// stop listening
_isStopped = true;
if (_tcpAcceptor != null)
{
_tcpAcceptor.Close();
_tcpAcceptor = null;
}
if (stopListenOnly)
{
return;
}
// stop all running channels
_isStopped = true;
if (_channelSet.Count > 0)
{
foreach (var channel in _channelSet)
{
channel.Cast <ActorBoundChannelRef>().WithNoReply().Close();
}
}
else
{
Self.Tell(InterfacedPoisonPill.Instance);
}
}