Пример #1
0
 internal HttpListenerContext (HttpConnection connection)
 {
   _connection = connection;
   _errorStatus = 400;
   _request = new HttpListenerRequest (this);
   _response = new HttpListenerResponse (this);
 }
Пример #2
0
 internal void RemoveConnection (HttpConnection connection)
 {
   lock (_connectionsSync)
     _connections.Remove (connection);
 }
Пример #3
0
    private void cleanupConnections ()
    {
      lock (_connectionsSync) {
        if (_connections.Count == 0)
          return;

        // Need to copy this since closing will call RemoveConnection.
        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);
      }
    }
Пример #4
0
 internal void AddConnection (HttpConnection connection)
 {
   lock (_connectionsSync)
     _connections[connection] = connection;
 }
Пример #5
0
 internal void RemoveConnection(HttpConnection connection)
 {
     lock (_unregisteredSync)
         _unregistered.Remove(connection);
 }