Inheritance: System.MarshalByRefObject, IRegisteredObject
        private Host GetHost()
        {
            if (_IsShutdownInProgress)
                return null;

            var host = _Host;

            if (host == null)
            {
                lock (this)
                {
                    host = _Host;
                    if (host == null)
                    {
                        host = (Host)CreateWorkerAppDomainWithHost(Website.VirtualRoot, Website.PhysicalPath, typeof(Host));
                        host.Configure(this, Website.Port, Website.VirtualRoot, Website.PhysicalPath);
                        _Host = host;
                    }
                }
            }

            return host;
        }
Exemple #2
0
 public Request(Server server, Host host, Connection connection)
     : base(String.Empty, String.Empty, null)
 {
     _server = server;
     _host = host;
     _connection = connection;
 }
 public Connection(Host host, Socket socket)
 {
     _host = host;
     _socket = socket;
 }
Exemple #4
0
 public Connection(Host host, Socket socket)
 {
     this._host = host;
     this._socket = socket;
 }
Exemple #5
0
 public void HostStopped()
 {
     _host = null;
 }
Exemple #6
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);
                        _host = host;
                    }
                }
            }

            return host;
        }
Exemple #7
0
        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;
            }
        }
Exemple #8
0
 public Request(Host host, Connection conn)
     : base(String.Empty, String.Empty, null)
 {
     _host = host;
     _conn = conn;
 }
Exemple #9
0
 private void CreateHost()
 {
     this._host = (Host)ApplicationHost.CreateApplicationHost(typeof(Host), this._virtualPath, this._physicalPath);
     //this._host = CreateWorkerAppDomianWithHost(this._virtualPath, this._physicalPath, typeof(Host)) as Host;
     this._host.Configure(this, this._port, this._virtualPath, this._physicalPath, this._installPath);
 }
Exemple #10
0
 private void CreateHost()
 {
     _host = (Host)ApplicationHost.CreateApplicationHost(typeof(Host), _virtualPath, _physicalPath);
     _host.Configure(this, _port, _virtualPath, _physicalPath, _installPath);
 }
Exemple #11
0
        public void Stop()
        {
            _shutdownInProgress = true;

            try
            {
                if (_mongrel2Connection != null)
                {
                    _mongrel2Connection.Dispose();
                }
            }
            catch
            {
            }
            finally
            {
                _mongrel2Connection = null;
            }

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

                while (_host != null)
                {
                    Thread.Sleep(100);
                }
            }
            catch
            {
            }
            finally
            {
                _host = null;
            }
        }
Exemple #12
0
        private Host GetHost()
        {
            if (_shutdownInProgress)
                return null;

            Host host = _host;

            if (host == null) {
                lock (this) {
                    host = _host;
                    if (host == null) {
                        // Put together some unique app id based on the virtual and physical paths
                        string uniqueAppString = String.Concat(_virtualPath, _physicalPath).ToLowerInvariant();
                        string appId = (uniqueAppString.GetHashCode()).ToString("x", CultureInfo.InvariantCulture);
                        _host = (Host)_appManager.CreateObject(appId, typeof(Host), _virtualPath, _physicalPath, false /*failIfExists*/);
                        _host.Configure(this, _port, _virtualPath, _physicalPath);
                        host = _host;
                    }
                }
            }

            return host;
        }
Exemple #13
0
 internal void HostStopped()
 {
     _host = null;
 }
Exemple #14
0
 public Request(Host host, Connection conn)
     : base(string.Empty, string.Empty, null)
 {
     this._host = host;
     this._conn = conn;
 }
 public void Stopped()
 {
     _Host = null;
 }