protected IncomingMessage(TcpSocket socket) { this.Connection = socket; this.HttpVersion = null; this.Headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); this.Trailers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); this.Readable = true; this.Method = null; }
public ServerRequest(TcpSocket socket) : base(socket) { this.Url = string.Empty; }
private void AcceptConnectionsTask() { while (!_tasksHandler.IsCancellationRequested) { Socket incoming; try { incoming = this._socket.Accept(); } catch(SocketException) { if (this._socket == null) //we got disposed { OnClosed(); return; } throw; } if (this.IsPaused) { //incoming.Disconnect(false); //incoming.Close(); //incoming.Dispose(); incoming.Shutdown(SocketShutdown.Both); _unpauseEvent.Wait(); _unpauseEvent.Reset(); //next wait will block continue; } var socket = new TcpSocket(incoming); lock (_sockets) { this._sockets.Add(socket); } this.OnConnection(socket); Thread.Sleep(0); //allow any ThreadInterruptedExceptions to bubble } }
protected virtual void OnConnection(TcpSocket socket) { this.Connection.TryInvoke(socket); }
public ClientResponse(TcpSocket socket) : base(socket) { }