/// <summary> /// Initializes a new instance of the <see cref="MessageFactoryContext"/> class. /// </summary> /// <param name="msgFactory">The MSG factory.</param> /// <param name="factory">The factory.</param> /// <param name="parser">The parser.</param> public MessageFactoryContext(MessageFactory msgFactory, HeaderFactory factory, HttpParser parser) { _msgFactory = msgFactory; _factory = factory; _parser = parser; parser.HeaderParsed += OnHeader; parser.MessageComplete += OnMessageComplete; parser.RequestLineParsed += OnRequestLine; parser.ResponseLineParsed += OnResponseLine; parser.BodyBytesReceived += OnBody; }
/// <summary> /// Initializes a new instance of the <see cref="MessageFactory"/> class. /// </summary> /// <param name="factory">Factory used to create headers.</param> public MessageFactory(HeaderFactory factory) { _factory = factory; _builders = new ObjectPool<MessageFactoryContext>(CreateBuilder); }
/// <summary> /// Initializes a new instance of the <see cref="HeaderCollection"/> class. /// </summary> /// <param name="factory">Factory used to created headers.</param> public HeaderCollection(HeaderFactory factory) { _factory = factory; }