private MessageFactoryContext CreateBuilder()
 {
     var mb = new MessageFactoryContext(this, _factory, new HttpParser());
     mb.RequestCompleted += OnRequest;
     mb.ResponseCompleted += OnResponse;
     return mb;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SecureHttpContext"/> class.
 /// </summary>
 /// <param name="protocols">SSL protocol to use.</param>
 /// <param name="socket">The socket.</param>
 /// <param name="context">The context.</param>
 /// <param name="certificate">Server certificate to use.</param>
 public SecureHttpContext(X509Certificate certificate, SslProtocols protocols, Socket socket,
                          MessageFactoryContext context)
     : base(socket, context)
 {
     _certificate = certificate;
     Protocol = protocols;
 }
		private int _keepAliveTimeout = 100000; // 100 seconds.

		/// <summary>
		/// Initializes a new instance of the <see cref="HttpContext"/> class.
		/// </summary>
		/// <param name="socket">Socket received from HTTP listener.</param>
		/// <param name="context">Context used to parse incoming messages.</param>
		public HttpContext(Socket socket, MessageFactoryContext context)
		{
			Socket = socket;
			MessageFactoryContext = context;
			MessageFactoryContext.RequestCompleted += OnRequest;
			MessageFactoryContext.ContinueResponseRequested += On100Continue;
		}
Example #4
0
        private MessageFactoryContext CreateBuilder()
        {
            var mb = new MessageFactoryContext(this, _factory, new HttpParser());

            mb.RequestCompleted  += OnRequest;
            mb.ResponseCompleted += OnResponse;
            return(mb);
        }
 /// <summary>
 /// Release a used factory context.
 /// </summary>
 /// <param name="factoryContext"></param>
 internal void Release(MessageFactoryContext factoryContext)
 {
     _builders.Enqueue(factoryContext);
 }
Example #6
0
 /// <summary>
 /// Release a used factory context.
 /// </summary>
 /// <param name="factoryContext"></param>
 internal void Release(MessageFactoryContext factoryContext)
 {
     _builders.Enqueue(factoryContext);
 }