示例#1
0
 private void RemoveSession(ProxySession session)
 {
     lock (sessions)
     {
         session.Close();
         sessions.Remove(session);
     }
 }
示例#2
0
            public void Stop()
            {
                if (listener != null)
                {
                    try
                    {
                        listener.Stop();
                    }
                    catch
                    {
                    }
                    listener = null;
                }

                if (thread != null)
                {
                    try
                    {
                        thread.Abort();
                    }
                    catch
                    {
                        thread = null;
                    }
                }

                lock (sessions)
                {
                    while (sessions.Count > 0)
                    {
                        ProxySession session = sessions[0];
                        session.Close();
                        sessions.Remove(session);
                    }

                    sessions.Clear();
                }
            }