Example #1
0
 public SessionEventArgs(AbstractSession session)
     : base()
 {
     this.Session = session;
 }
Example #2
0
 public SessionEventArgs(AbstractSession session, Exception ex)
     : this(session)
 {
     this.SessionException = ex;
 }
Example #3
0
 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));
     }
 }
Example #4
0
 protected virtual void OnSessionException(AbstractSession session, Exception ex)
 {
     if (this.SessionException != null)
     {
         this.SessionException(this, new SessionEventArgs(session, ex));
     }
 }
Example #5
0
 protected virtual void OnSessionEnded(AbstractSession session)
 {
     lock (this._sync)
     {
         this._session = null;
     }
     if (this.SessionEnded != null)
     {
         this.SessionEnded(this, new SessionEventArgs(session));
     }
 }
Example #6
0
 protected virtual void OnMessageReceived(AbstractSession session, MessageEventArgs e)
 {
     if (this.MessageReceived != null)
     {
         this.MessageReceived(this, e);
     }
 }
Example #7
0
 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;
         }
     }
 }