public void OnDisconnect(HeliosConnectionException cause, IConnection closedChannel) { _log.Debug("disconnected from {0}", closedChannel.RemoteHost); _fsm.Tell(PoisonPill.Instance); //TODO: Some logic here in JVM version to execute this on a different pool to the Netty IO pool RemoteConnection.Shutdown(closedChannel); }
protected override void PostStop() { try { RemoteConnection.Shutdown(_connection); RemoteConnection.ReleaseAll().Wait(_settings.ConnectTimeout); } catch (Exception ex) { _log.Error(ex, "Error while terminating RemoteConnection."); } }
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); }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default); context.FireChannelInactive(); }
protected override void PostStop() { RemoteConnection.Shutdown(_connection); }