public virtual void Execute() { try { int receiveBufferSize = (int)this._socket.GetSocketOption(System.Net.Sockets.SocketOptionLevel.Socket, System.Net.Sockets.SocketOptionName.ReceiveBuffer); int sendBufferSize = (int)this._socket.GetSocketOption(System.Net.Sockets.SocketOptionLevel.Socket, System.Net.Sockets.SocketOptionName.SendBuffer); Bamboo.WebServer.NetworkStream networkStream = new Bamboo.WebServer.NetworkStream(this._socket); Bamboo.WebServer.BufferedStream bufferedStream = new Bamboo.WebServer.BufferedStream(networkStream, receiveBufferSize, sendBufferSize); this._preProcessor.PreProcess(this._socket, bufferedStream); bufferedStream.Close(); } catch (System.Exception exception) { this.Error(exception); } try { this._socket.Close(); } catch (System.Exception exception) { this.Error(exception); } this._socket = null; this._preProcessor = null; }
protected virtual SecureHttpServerWorker CreateWorker(System.Net.Sockets.Socket socket, HttpPreProcessor preProcessor, byte[] certificate, byte[] privateKey) { return(new SecureHttpServerWorker(socket, preProcessor, certificate, privateKey)); }
public HttpServer(HttpPreProcessor preProcessor) { this._preProcessor = preProcessor; }
protected virtual HttpServerWorker CreateWorker(System.Net.Sockets.Socket socket, HttpPreProcessor preProcessor) { return(new HttpServerWorker(socket, preProcessor)); }
public HttpServerWorker(System.Net.Sockets.Socket socket, HttpPreProcessor preProcessor) { this._socket = socket; this._preProcessor = preProcessor; }