Пример #1
0
 private MessageFactoryContext CreateBuilder()
 {
   var mb = new MessageFactoryContext(this, _factory, new MessageParser());
   mb.RequestCompleted += OnRequest;
   mb.ResponseCompleted += OnResponse;
   return mb;
 }
Пример #2
0
        private MessageFactoryContext CreateBuilder()
        {
            var mb = new MessageFactoryContext(this, _factory, new MessageParser());

            mb.RequestCompleted  += OnRequest;
            mb.ResponseCompleted += OnResponse;
            return(mb);
        }
Пример #3
0
    private int _keepAliveTimeout = 100000; // 100 seconds.

    #endregion

    #region Ctors
    
    /// <summary>
    /// HTTP请求的上下文接口,由HTTP监听器在接受Socket时创建
    /// </summary>
    /// <param name="socket">HTTP监听器接受的Socket</param>
    /// <param name="context">用于解析消息内容的消息工厂上下文</param>
    public HttpContext(Socket socket, MessageFactoryContext context)
    {
      Socket = socket;

      MessageFactoryContext = context;
      MessageFactoryContext.RequestCompleted += OnRequest;
      MessageFactoryContext.ContinueResponseRequested += On100Continue;

      _buffer = Buffers.Dequeue();
    }
Пример #4
0
 /// <summary>
 /// HTTP请求的上下文接口,由HTTP监听器在接受Socket时创建
 /// </summary>
 /// <param name="certificate">服务器端使用的证书</param>
 /// <param name="protocols">SSL协议</param>
 /// <param name="socket">The socket.</param>
 /// <param name="context">The context.</param>
 internal SecureHttpContext(X509Certificate certificate, SslProtocols protocols, Socket socket, MessageFactoryContext context)
   : base(socket, context)
 {
   _certificate = certificate;
   Protocol = protocols;
 }
Пример #5
0
 /// <summary>
 /// Release a used factory context.
 /// </summary>
 /// <param name="factoryContext"></param>
 internal void Release(MessageFactoryContext factoryContext)
 {
   _builders.Enqueue(factoryContext);
 }
Пример #6
0
 /// <summary>
 /// Release a used factory context.
 /// </summary>
 /// <param name="factoryContext"></param>
 internal void Release(MessageFactoryContext factoryContext)
 {
     _builders.Enqueue(factoryContext);
 }