ReleaseAll() public static method

public static ReleaseAll ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
示例#1
0
 protected override void PostStop()
 {
     try
     {
         RemoteConnection.Shutdown(_connection);
         RemoteConnection.ReleaseAll().Wait(_settings.ConnectTimeout);
     }
     catch (Exception ex)
     {
         _log.Error(ex, "Error while terminating RemoteConnection.");
     }
 }
示例#2
0
        public override void ChannelInactive(IChannelHandlerContext context)
        {
            if (!_loggedDisconnect) //added this to help mute log messages
            {
                _loggedDisconnect = true;
                _log.Debug("disconnected from {0}", context.Channel.RemoteAddress);
            }
            _fsm.Tell(PoisonPill.Instance);

            // run outside of the Helios / DotNetty threadpool
            Task.Factory.StartNew(() =>
            {
                RemoteConnection.Shutdown(context.Channel);
                RemoteConnection.ReleaseAll(); // yep, let it run asynchronously.
            }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default);
            context.FireChannelInactive();
        }