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); }
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); }