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; } }
public static void AddPrefix(string prefix, HttpListener listener) { Hashtable obj = EndPointManager.ip_to_endpoints; lock (obj) { EndPointManager.AddPrefixInternal(prefix, listener); } }