示例#1
0
文件: s2h.asmx.cs 项目: aloux00/s2h
        public long Ready(string auth, string Token)
        {
            S2hState  s2hState = (S2hState)Application["s2hState"];
            s2hClient Client   = s2hState.GetClient(auth);

            if (Client == null)
            {
                return((long)s2h_errors.s2h_client_not_authenticated);
            }

            s2hConnection connection = Client.GetConnection(Token);

            if (connection == null)
            {
                return((long)s2h_errors.s2h_unknown_connection_token);
            }

            connection.bReady = true;

            return((long)s2h_errors.s2h_ok);
        }
示例#2
0
文件: s2h.asmx.cs 项目: aloux00/s2h
        public long Close(string auth, string[] Tokens)
        {
            long      lRes     = (long)s2h_errors.s2h_ok;
            S2hState  s2hState = (S2hState)Application["s2hState"];
            s2hClient Client   = s2hState.GetClient(auth);

            if (Client == null)
            {
                return((long)s2h_errors.s2h_client_not_authenticated);
            }

            foreach (string t in Tokens)
            {
                s2hConnection connection = Client.GetConnection(t);
                if (connection == null)
                {
                    lRes = (long)s2h_errors.s2h_unknown_connection_token;
                }
                s2hState.Exchanger.CloseConnection(t);
                Client.RemoveConnection(connection.handle);
            }
            return(lRes);
        }