public ProtocolSession(SecureSocket socket, ProtocolOptions options)
{
this.isFlowControlEnabled = options.IsFlowControl;
this.streams = new List<Http2Stream>();
this.closedStreams = new List<Http2Stream>();
this.isServer = true;
this.CurrentWindowBalanceToServer = 512;
this.CurrentWindowBalanceFromServer = 256;
this.protocol = new Http2Protocol(socket, this, options);
this.protocol.OnSessionFrame += this.OnSessionFrame;
this.protocol.OnClose += this.OnProtocolClose;
this.protocol.OnOpen += this.OnProtocolOpen;
this.protocol.OnError += this.OnProtocolError;
this.protocol.OnPing += this.OnProtocolPing;
if (options.UseCompression)
{
this.Protocol.SetProcessors(new List<IMessageProcessor> { new CompressionProcessor() });
}
}