예제 #1
0
        public static HttpListenerServer Create(HttpListenerServerListener listener, ServerTaskPoolOptions options, bool useSinglePool)
        {
            MethodContract.NotNull(listener, nameof(listener));
            MethodContract.NotNull(options, nameof(options));

            if (useSinglePool)
            {
                return(new HttpListenerServer(new SingleServerTaskPool <HttpContext>(listener, options), listener));
            }
            else
            {
                return(new HttpListenerServer(new DualServerTaskPool <HttpContext>(listener, options), listener));
            }
        }
예제 #2
0
 private HttpListenerServer(ServerTaskPool <HttpContext> pool, HttpListenerServerListener listener) : base(pool)
 {
     this.listener = listener;
 }