Пример #1
0
        Host GetHost()
        {
            if (_shutdownInProgress)
            {
                return null;
            }

            Host host = _host;

            if (host == null)
            {
                lock (this) {
                    host = _host;

                    if (host == null)
                    {
                        host = (Host)CreateWorkerAppDomainWithHost(_virtualPath, _physicalPath, typeof(Host));
                        host.Configure(this, _port, _virtualPath, _physicalPath, _defaultPage, _allowRemoteConnection, _logPageRequests);
                        _host = host;
                    }
                }
            }

            return host;
        }
Пример #2
0
        /// <summary>
        /// Stops the server
        /// </summary>
        public void Stop()
        {
            _shutdownInProgress = true;

            try
            {
                if (_socket != null)
                {
                    _socket.Close();
                }
            }
            catch
            {
            }
            finally
            {
                _socket = null;
            }

            try
            {
                if (_host != null)
                {
                    _host.Shutdown();
                }

                while (_host != null)
                {
                    Thread.Sleep(100);
                }
            }
            catch
            {
            }
            finally
            {
                _host = null;
            }
        }
Пример #3
0
 /// <summary>
 /// Sets the host object to null
 /// </summary>
 public void HostStopped()
 {
     _host = null;
 }
Пример #4
0
 public Request(Server server, Host host, Connection connection) : base(String.Empty, String.Empty, null)
 {
     _server = server;
     _host = host;
     _connection = connection;
 }