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;
        }
Ejemplo n.º 2
0
 public Request(Server server, Host host, Connection connection)
     : base(String.Empty, String.Empty, null)
 {
     _server = server;
     _host = host;
     _connection = connection;
 }
Ejemplo n.º 3
0
 public Connection(Host host, Socket socket)
 {
     _host = host;
     _socket = socket;
 }
Ejemplo n.º 4
0
 public Connection(Host host, Socket socket)
 {
     this._host = host;
     this._socket = socket;
 }
Ejemplo n.º 5
0
 public void HostStopped()
 {
     _host = null;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 8
0
 public Request(Host host, Connection conn)
     : base(String.Empty, String.Empty, null)
 {
     _host = host;
     _conn = conn;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 10
0
 private void CreateHost()
 {
     _host = (Host)ApplicationHost.CreateApplicationHost(typeof(Host), _virtualPath, _physicalPath);
     _host.Configure(this, _port, _virtualPath, _physicalPath, _installPath);
 }
Ejemplo n.º 11
0
Archivo: Server.cs Proyecto: kxie/m2net
        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;
            }
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 13
0
 internal void HostStopped()
 {
     _host = null;
 }
Ejemplo n.º 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;
 }