void RegisterListener()
 {
     lock (ThisLock)
     {
         if (this.State == CommunicationState.Opening)
         {
             LocalTransportManager.RegisterListener(this);
             this.channelRegistered = true;
         }
     }
 }
 void DisposeChannelQueue()
 {
     this.channelQueue.Close();
     lock (ThisLock)
     {
         if (this.channelRegistered)
         {
             LocalTransportManager.UnregisterListener(this);
             this.channelRegistered = false;
         }
     }
 }
 protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
 {
     return(LocalTransportManager.BeginConnectServerChannel(this.sendQueue, this.receiveQueue,
                                                            this.LocalAddress, this.Via, timeout, callback, state));
 }
 protected override void OnEndOpen(IAsyncResult result)
 {
     LocalTransportManager.EndConnectServerChannel(result, this.Via);
 }
 protected override void OnOpen(TimeSpan timeout)
 {
     LocalTransportManager.ConnectServerChannel(this.sendQueue, this.receiveQueue, this.LocalAddress, this.Via, timeout);
 }