Esempio n. 1
0
 protected void Stop(NetStoppedReason reason)
 {
     if (!this.IsActive)
     {
         return;
     }
     this.IsActive = false;
     this.stream.Close();
     if (this.OnStopped != null)
     {
         this.OnStopped(this, new NetStreamStoppedEventArgs(this.Guid, reason));
     }
 }
Esempio n. 2
0
 protected void Stop(NetStoppedReason reason)
 {
     if (!this.active)
     {
         return;
     }
     this.DisconnectAll();
     this.tcp.Stop();
     this.active = false;
     if (this.OnStopped != null)
     {
         this.OnStopped(this, new NetStoppedEventArgs(reason));
     }
 }
Esempio n. 3
0
 protected void Disconnect(NetStoppedReason reason)
 {
     if (!this.IsConnected)
     {
         return;
     }
     this.stream.Stop();
     this.tcp.Close();
     this.IsConnected = false;
     if (this.OnDisconnected != null)
     {
         this.OnDisconnected(this, new NetDisconnectedEventArgs(reason));
     }
 }
 public NetClientDisconnectedEventArgs(Guid guid, NetStoppedReason reason) : base(guid, reason)
 {
 }
 public NetDisconnectedEventArgs(NetStoppedReason reason)
 {
     this.Reason = reason;
 }
Esempio n. 6
0
 public NetStreamStoppedEventArgs(Guid guid, NetStoppedReason reason) : base(guid)
 {
     this.Reason = reason;
 }