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