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;
        }