internal HttpListenerContext(HttpConnection connection)
 {
     _connection = connection;
       _errorStatus = 400;
       _request = new HttpListenerRequest (this);
       _response = new HttpListenerResponse (this);
 }
Esempio n. 2
0
        private void cleanupConnections()
        {
            lock (_connectionsSync) {
            if (_connections.Count == 0)
              return;

            // Need to copy this since closing will call the RemoveConnection method.
            var keys = _connections.Keys;
            var conns = new HttpConnection[keys.Count];
            keys.CopyTo (conns, 0);
            _connections.Clear ();
            for (var i = conns.Length - 1; i >= 0; i--)
              conns[i].Close (true);
              }
        }
Esempio n. 3
0
 internal void RemoveConnection(HttpConnection connection)
 {
     lock (_connectionsSync)
     _connections.Remove (connection);
 }
Esempio n. 4
0
 internal void AddConnection(HttpConnection connection)
 {
     lock (_connectionsSync)
     _connections[connection] = connection;
 }