// Process Disconnect message from the neighbor public void Disconnect(IPeerNeighbor neighbor, DisconnectInfo disconnectInfo) { // Don't bother processing the message if Connector has closed if (this.state != State.Opened) { return; } PeerCloseReason closeReason = PeerCloseReason.InvalidNeighbor; IList <Referral> referrals = null; if (disconnectInfo.HasBody()) { // We should only receive Disconnect message after the neighbor has transitioned // to connected state. if (neighbor.State >= PeerNeighborState.Connected) { if (PeerConnectorHelper.IsDefined(disconnectInfo.Reason)) { closeReason = (PeerCloseReason)disconnectInfo.Reason; referrals = disconnectInfo.Referrals; } } } // Complete processing of disconnect message CompleteTerminateMessageProcessing(neighbor, closeReason, referrals); }
public void Disconnect(IPeerNeighbor neighbor, DisconnectInfo disconnectInfo) { if (this.state == State.Opened) { PeerCloseReason invalidNeighbor = PeerCloseReason.InvalidNeighbor; IList <Referral> referrals = null; if ((disconnectInfo.HasBody() && (neighbor.State >= PeerNeighborState.Connected)) && PeerConnectorHelper.IsDefined(disconnectInfo.Reason)) { invalidNeighbor = (PeerCloseReason)disconnectInfo.Reason; referrals = disconnectInfo.Referrals; } this.CompleteTerminateMessageProcessing(neighbor, invalidNeighbor, referrals); } }
// Process Disconnect message from the neighbor public void Disconnect(IPeerNeighbor neighbor, DisconnectInfo disconnectInfo) { // Don't bother processing the message if Connector has closed if (this.state != State.Opened) return; PeerCloseReason closeReason = PeerCloseReason.InvalidNeighbor; IList<Referral> referrals = null; if (disconnectInfo.HasBody()) { // We should only receive Disconnect message after the neighbor has transitioned // to connected state. if (neighbor.State >= PeerNeighborState.Connected) { if (PeerConnectorHelper.IsDefined(disconnectInfo.Reason)) { closeReason = (PeerCloseReason)disconnectInfo.Reason; referrals = disconnectInfo.Referrals; } } } // Complete processing of disconnect message CompleteTerminateMessageProcessing(neighbor, closeReason, referrals); }
public void Disconnect(IPeerNeighbor neighbor, DisconnectInfo disconnectInfo) { if (this.state == State.Opened) { PeerCloseReason invalidNeighbor = PeerCloseReason.InvalidNeighbor; IList<Referral> referrals = null; if ((disconnectInfo.HasBody() && (neighbor.State >= PeerNeighborState.Connected)) && PeerConnectorHelper.IsDefined(disconnectInfo.Reason)) { invalidNeighbor = (PeerCloseReason) disconnectInfo.Reason; referrals = disconnectInfo.Referrals; } this.CompleteTerminateMessageProcessing(neighbor, invalidNeighbor, referrals); } }