Example #1
0
        static IServer CreateOnDemandServer(ConfigurationManager configurationManager, Socket socket)
        {
            var server = new OnDemandServer(socket)
            {
                MaxConnections       = configurationManager.MaxConns,
                MaxRequests          = configurationManager.MaxReqs,
                MultiplexConnections = configurationManager.Multiplex
            };

            server.SetResponder(typeof(Responder));

            Logger.Write(LogLevel.Debug, "Max connections: {0}", server.MaxConnections);
            Logger.Write(LogLevel.Debug, "Max requests: {0}", server.MaxRequests);
            Logger.Write(LogLevel.Debug, "Multiplex connections: {0}", server.MultiplexConnections);
            return(server);
        }
Example #2
0
File: main.cs Project: zofuthan/xsp
        static IServer CreateOnDemandServer(ConfigurationManager configurationManager, Socket socket)
        {
            if (configurationManager == null)
            {
                throw new ArgumentNullException("configurationManager");
            }
            if (socket == null)
            {
                throw new ArgumentNullException("socket");
            }
            var server = new OnDemandServer(socket)
            {
                MaxConnections       = configurationManager.MaxConns,
                MaxRequests          = configurationManager.MaxReqs,
                MultiplexConnections = configurationManager.Multiplex
            };

            server.SetResponder(typeof(Responder));

            Logger.Write(LogLevel.Debug, "Max connections: {0}", server.MaxConnections);
            Logger.Write(LogLevel.Debug, "Max requests: {0}", server.MaxRequests);
            Logger.Write(LogLevel.Debug, "Multiplex connections: {0}", server.MultiplexConnections);
            return(server);
        }