public AddPrefix ( System.Net.ListenerPrefix prefix, |
||
prefix | System.Net.ListenerPrefix | |
listener | ||
리턴 | void |
private static void AddPrefixInternal(string p, HttpListener listener) { ListenerPrefix listenerPrefix = new ListenerPrefix(p); if (listenerPrefix.Path.IndexOf('%') != -1) { throw new HttpListenerException(400, "Invalid path."); } if (listenerPrefix.Path.IndexOf("//") != -1) { throw new HttpListenerException(400, "Invalid path."); } EndPointListener eplistener = EndPointManager.GetEPListener(IPAddress.Any, listenerPrefix.Port, listener, listenerPrefix.Secure); eplistener.AddPrefix(listenerPrefix, listener); }
static void AddPrefixInternal(string p, HttpListener listener) { ListenerPrefix lp = new ListenerPrefix(p); if (lp.Path.IndexOf('%') != -1) { throw new HttpListenerException(400, "Invalid path."); } if (lp.Path.IndexOf("//") != -1) // TODO: Code? { throw new HttpListenerException(400, "Invalid path."); } // Always listens on all the interfaces, no matter the host name/ip used. EndPointListener epl = GetEPListener(IPAddress.Any, lp.Port, listener, lp.Secure); epl.AddPrefix(lp, listener); }
static void AddPrefixInternal(string p, HttpListener listener) { ListenerPrefix lp = new ListenerPrefix(p); if (lp.Path.IndexOf('%') != -1) { throw new HttpListenerException(400, "Invalid path."); } if (lp.Path.IndexOf("//", StringComparison.Ordinal) != -1) // TODO: Code? { throw new HttpListenerException(400, "Invalid path."); } // listens on all the interfaces if host name cannot be parsed by IPAddress. EndPointListener epl = GetEPListener(lp.Host, lp.Port, listener, lp.Secure); epl.AddPrefix(lp, listener); }