public static bool CloseConnection(string Data) { PushConnectNetworkData pdata = null; NetRedirWS redir = null; try { pdata = JsonConvert.DeserializeObject <PushConnectNetworkData>(Data); } catch (Exception ee) { Debug.WriteLine(ee.ToString()); } if (pdata == null) { return(false); } lock (Locker) { if (Redirs.ContainsKey(pdata.GUID) == false) { return(false); } redir = Redirs[pdata.GUID]; } return(redir.CloseConnection()); }
public static string StartNetRedir(Network net, string SessionID, string ToServer, int Port) { NetRedirWS R = new NetRedirWS(net, ToServer, Port, SessionID); if (R.InitSuccess == false) { return(""); } lock (Locker) { Redirs.Add(SessionID, R); } return(SessionID); }