/////////////////////////////////// // 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(); } }
/// <summary> /// Request a KAS to be disconnected. /// </summary> public void RequestKasDisconnect(TbxAppServerId kasID) { lock (m_mutex) { m_ToKcmControlMsgArray.Add(new TcmConnectionRequest(kasID, false)); NotifyTcm(); } }
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)); }
public TcmConnectionNotice(TbxAppServerId kasID, UInt32 minorVersion) { KasID = kasID; MinorVersion = minorVersion; }
public TcmConnectionRequest(TbxAppServerId kasID, bool connectFlag) { KasID = kasID; ConnectFlag = connectFlag; }
public TcmAnpMsg(AnpMsg msg, TbxAppServerId kasID) { Msg = msg; KasID = kasID; }
public TcmDisconnectionNotice(TbxAppServerId kasID, Exception ex) { KasID = kasID; Ex = ex; }
public TbxAppServer(TbxAppServerId kasID) { KasID = kasID; Tunnel = new AnpTunnel(KasID.Host, (int)KasID.Port); }