/// <summary> /// Fires whenever a Helios <see cref="IConnection"/> gets closed. /// /// Two possible causes for this event handler to fire: /// * The other end of the connection has closed. We don't make any distinctions between graceful / unplanned shutdown. /// * This end of the connection experienced an error. /// </summary> /// <param name="cause">An exception describing why the socket was closed.</param> /// <param name="closedChannel">The handle to the socket channel that closed.</param> protected override void OnDisconnect(HeliosConnectionException cause, IConnection closedChannel) { //if (cause != null) // ChannelLocalActor.Notify(closedChannel, new UnderlyingTransportError(cause, "Underlying transport closed.")); ChannelLocalActor.Notify(closedChannel, new Disassociated(DisassociateInfo.Unknown)); ChannelLocalActor.Remove(closedChannel); }
protected override void OnDisconnect(HeliosConnectionException cause, IConnection closedChannel) { if (cause != null) { ChannelLocalActor.Notify(closedChannel, new UnderlyingTransportError(cause, "Underlying transport closed.")); } if (cause != null && cause.Type == ExceptionType.Closed) { ChannelLocalActor.Notify(closedChannel, new Disassociated(DisassociateInfo.Shutdown)); } else { ChannelLocalActor.Notify(closedChannel, new Disassociated(DisassociateInfo.Unknown)); } ChannelLocalActor.Remove(closedChannel); }
public override void Dispose() { ChannelLocalActor.Remove(UnderlyingConnection); base.Dispose(); }