예제 #1
0
        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;
        }
예제 #2
0
 protected virtual SecureHttpServerWorker CreateWorker(System.Net.Sockets.Socket socket, HttpPreProcessor preProcessor, byte[] certificate, byte[] privateKey)
 {
     return(new SecureHttpServerWorker(socket, preProcessor, certificate, privateKey));
 }
예제 #3
0
 public HttpServer(HttpPreProcessor preProcessor)
 {
     this._preProcessor = preProcessor;
 }
예제 #4
0
 protected virtual HttpServerWorker CreateWorker(System.Net.Sockets.Socket socket, HttpPreProcessor preProcessor)
 {
     return(new HttpServerWorker(socket, preProcessor));
 }
예제 #5
0
 public HttpServerWorker(System.Net.Sockets.Socket socket, HttpPreProcessor preProcessor)
 {
     this._socket       = socket;
     this._preProcessor = preProcessor;
 }