Exemplo n.º 1
0
 //--------------------------------------------------------------------
 public void DeRegisterSession(CDEFSession sess)
 {
     if (mSessions.ContainsKey(sess.GetKey))
     {
         mSessions.Remove(sess.GetKey);
     }
     //
     // If it is the last session and we are not waiting for
     // a disconnect as a result of sending a 3309
     //
     if ((mSessions.Count == 0) && !mDisconnect.WaitOne(0, false))
     {
         Disconnect();
     }
 }
Exemplo n.º 2
0
 public void SessionDisconnectedEvt(CDEFSession source)
 {
     mDiconnected(source);
 }
Exemplo n.º 3
0
 public void SessionConnectFailedEvt(CDEFSession source, int timeout)
 {
     mConFail(source, timeout);
 }
Exemplo n.º 4
0
 public void SessionConnectedEvt(CDEFSession source)
 {
     mConnected(source);
 }
Exemplo n.º 5
0
 public void MessageReadyEvt(CDEFSession source)
 {
     mMsgRec(source);
 }
Exemplo n.º 6
0
 public bool InterestedCb(CDEFSession source, byte[] buffer, int idx, int bufferLength)
 {
     return mInterested(source, buffer, idx, bufferLength);
 }
Exemplo n.º 7
0
        //--------------------------------------------------------------------
        /// <summary>
        /// Inform the upper layers of event that have occured
        /// </summary>
        protected override void DisconnectedEvt(Exception e)
        {
            string msg;
            DisableHeartbeats();

            if (e != null)
            {
                msg = "Remote Disconnect for " + IP + " " + Port
                    + " Msg: " + e.Message;
            }
            else
            {
                msg = "Disconnect for " + IP + " " + Port + " current state: " + State.GetState();
            }
            mLogger.Write(mUniqueID, "CDEF_TCPCon", msg, LogLevel.Warning);
            mOwner.DisconnectedEvt(mUniqueID);

            CDEFSession[] sessArr = new CDEFSession[mSessions.Count];
            mSessions.Values.CopyTo(sessArr, 0);

            foreach (CDEFSession s in sessArr)
            {
                s.ConnectionLostEvt();
            }
        }
Exemplo n.º 8
0
 //--------------------------------------------------------------------
 public void RegisterSession(CDEFSession sess)
 {
     if (mSessions.ContainsKey(sess.GetKey))
     {
         throw new Exception("Session: " + sess.ToString()
          + " already exists on connection " + this.ToString());
     }
     else
     {
         mSessions.Add(sess.GetKey, sess);
     }
 }