public SessionEventArgs(AbstractSession session) : base() { this.Session = session; }
public SessionEventArgs(AbstractSession session, Exception ex) : this(session) { this.SessionException = ex; }
protected virtual void OnSesstionStarted(AbstractSession session) { lock (this._sync) { this._session = session; this._manualEvent.Set(); } if (this.SessionStarted != null) { this.SessionStarted(this, new SessionEventArgs(session)); } }
protected virtual void OnSessionException(AbstractSession session, Exception ex) { if (this.SessionException != null) { this.SessionException(this, new SessionEventArgs(session, ex)); } }
protected virtual void OnSessionEnded(AbstractSession session) { lock (this._sync) { this._session = null; } if (this.SessionEnded != null) { this.SessionEnded(this, new SessionEventArgs(session)); } }
protected virtual void OnMessageReceived(AbstractSession session, MessageEventArgs e) { if (this.MessageReceived != null) { this.MessageReceived(this, e); } }
public void Dispose() { if (this._monitorThread != null) { this._monitorThread.Abort(); this._monitorThread = null; } if (this._heartBeatThread != null) { this._heartBeatThread.Abort(); this._heartBeatThread = null; } lock (this._sync) { if (this._session != null) { this._session.Dispose(); this._session = null; } } }