public void Dispose()
 {
     this.callback = null;
     this.receiver.Close();
 }
 public IDisposable OnPacket(PacketReceivedCallback receivedCallback)
 {
     Contract.Requires <ArgumentNullException>(receivedCallback != null);
     return(default(IDisposable));
 }
 public IDisposable OnPacket(PacketReceivedCallback receivedCallback)
 {
     this.callback += receivedCallback;
     return(new DisposeAction(() => this.callback -= receivedCallback));
 }