private void Channel_Disconnected(object sender, PipeChannelEventArgs e) { var currentChannel = Interlocked.Exchange(ref channel, null); if (currentChannel != null) { currentChannel.Dispose(); } }
private void Channel_DataReceived(object sender, PipeChannelEventArgs e) { var message = serializer.Deserialize(e.Data); Dispatch(message); }
private void Channel_Disconnected(object sender, PipeChannelEventArgs e) { Disconnected?.Invoke(this, EventArgs.Empty); }