Beispiel #1
0
        public RestServer(IServerSettings options)
        {
            Listener  = new Interfaces.Server.HttpListener(new Mono.Net.HttpListener());
            Listening = new Thread(HandleRequests);
            StopEvent = new ManualResetEvent(false);

            options.CloneEventHandlers(this);
            Host          = options.Host;
            Port          = options.Port;
            PublicFolders = options.PublicFolders;
            Router        = options.Router;
            Logger        = options.Logger;
            UseHttps      = options.UseHttps;

            _dependencyResolver = options.DependencyResolver;

            /* Obsolete */
            Connections   = options.Connections;
            OnBeforeStart = options.OnBeforeStart;
            OnAfterStart  = options.OnAfterStart;
            OnBeforeStop  = options.OnBeforeStop;
            OnAfterStop   = options.OnAfterStop;

            Advanced = new AdvancedRestServer(Listener);
            Listener.IgnoreWriteExceptions = true;
        }
Beispiel #2
0
        public RestServer(IServerSettings options)
        {
            Listener  = new HttpListener(new System.Net.HttpListener());
            Listening = new Thread(HandleRequests);
            StopEvent = new ManualResetEvent(false);

            options.CloneEventHandlers(this);
            Host          = options.Host;
            Logger        = options.Logger;
            Port          = options.Port;
            PublicFolders = options.PublicFolders;
            Router        = options.Router;
            UseHttps      = options.UseHttps;

            Advanced = new AdvancedRestServer(Listener);
            Listener.IgnoreWriteExceptions = true;
        }
Beispiel #3
0
        public RestServer(IServerSettings options)
        {
            Listener   = new HttpListener(new System.Net.HttpListener());
            Listening  = new Thread(HandleRequests);
            Queue      = new ConcurrentQueue <HttpListenerContext>();
            ReadyEvent = new ManualResetEvent(false);
            StopEvent  = new ManualResetEvent(false);

            Connections   = options.Connections;
            Host          = options.Host;
            Logger        = options.Logger;
            OnBeforeStart = options.OnBeforeStart;
            OnAfterStart  = options.OnAfterStart;
            OnBeforeStop  = options.OnBeforeStop;
            OnAfterStop   = options.OnAfterStop;
            Port          = options.Port;
            PublicFolder  = options.PublicFolder;
            Router        = options.Router;
            UseHttps      = options.UseHttps;

            Advanced = new AdvancedRestServer(Listener);
            Listener.IgnoreWriteExceptions = true;
        }