Ejemplo n.º 1
0
        public static void AddListener(HttpListener listener)
        {
            ArrayList arrayList = new ArrayList();

            try
            {
                Hashtable obj = EndPointManager.ip_to_endpoints;
                lock (obj)
                {
                    foreach (string text in listener.Prefixes)
                    {
                        EndPointManager.AddPrefixInternal(text, listener);
                        arrayList.Add(text);
                    }
                }
            }
            catch
            {
                foreach (object obj2 in arrayList)
                {
                    string prefix = (string)obj2;
                    EndPointManager.RemovePrefix(prefix, listener);
                }
                throw;
            }
        }
Ejemplo n.º 2
0
        public static void AddPrefix(string prefix, HttpListener listener)
        {
            Hashtable obj = EndPointManager.ip_to_endpoints;

            lock (obj)
            {
                EndPointManager.AddPrefixInternal(prefix, listener);
            }
        }