示例#1
0
        ///////////////////////////////////
        // Interface methods for the WM. //
        ///////////////////////////////////

        /// <summary>
        /// Request a KAS to be connected.
        /// </summary>
        public void RequestAppServerConnect(TbxAppServerId kasID)
        {
            lock (m_mutex)
            {
                // The following sequence of events can happen:
                // - KCM posts disconnection event.
                // - WM posts ANP message.
                // - WM receives disconnection event.
                // - WM posts connection request.
                // - KCM receives connection request and ANP message concurrently,
                //   possibly posting the ANP message incorrectly.
                // To prevent this situation, we ensure that we have no lingering
                // ANP message left for that KAS.
                List <TcmAnpMsg> newList = new List <TcmAnpMsg>();

                foreach (TcmAnpMsg m in m_ToKcmAnpMsgArray)
                {
                    if (m.KasID != kasID)
                    {
                        newList.Add(m);
                    }
                }

                m_ToKcmAnpMsgArray = newList;

                m_ToKcmControlMsgArray.Add(new TcmConnectionRequest(kasID, true));
                NotifyTcm();
            }
        }
示例#2
0
 /// <summary>
 /// Request a KAS to be disconnected.
 /// </summary>
 public void RequestKasDisconnect(TbxAppServerId kasID)
 {
     lock (m_mutex)
     {
         m_ToKcmControlMsgArray.Add(new TcmConnectionRequest(kasID, false));
         NotifyTcm();
     }
 }
示例#3
0
        public int CompareTo(Object obj)
        {
            TbxAppServerId appServerId = (TbxAppServerId)obj;

            int r = appServerId.Host.CompareTo(Host);

            if (r != 0)
            {
                return(r);
            }

            return(appServerId.Port.CompareTo(Port));
        }
示例#4
0
 public TcmConnectionNotice(TbxAppServerId kasID, UInt32 minorVersion)
 {
     KasID        = kasID;
     MinorVersion = minorVersion;
 }
示例#5
0
 public TcmConnectionRequest(TbxAppServerId kasID, bool connectFlag)
 {
     KasID       = kasID;
     ConnectFlag = connectFlag;
 }
示例#6
0
 public TcmAnpMsg(AnpMsg msg, TbxAppServerId kasID)
 {
     Msg   = msg;
     KasID = kasID;
 }
示例#7
0
 public TcmDisconnectionNotice(TbxAppServerId kasID, Exception ex)
 {
     KasID = kasID;
     Ex    = ex;
 }
示例#8
0
 public TbxAppServer(TbxAppServerId kasID)
 {
     KasID  = kasID;
     Tunnel = new AnpTunnel(KasID.Host, (int)KasID.Port);
 }