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)); } }
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)); } }
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; }
public NetStreamStoppedEventArgs(Guid guid, NetStoppedReason reason) : base(guid) { this.Reason = reason; }