public static IBootstrapWrapper AddQuoteOfTheMomentHandler <TChannelHandler>(this IBootstrapWrapper wrapper,
                                                                                     TChannelHandler channelHandler)
            where TChannelHandler : IChannelHandler
        {
            wrapper.NotNull(nameof(wrapper));

            return(wrapper.AddChannelHandlerAsync <IChannel>(tlsCertificate: null, pipeline =>
            {
                pipeline.AddLast("Quote", channelHandler);
            }));
        }
        public static IBootstrapWrapper AddDiscardHandler <TChannelHandler>(this IBootstrapWrapper wrapper,
                                                                            X509Certificate2 tlsCertificate, TChannelHandler channelHandler)
            where TChannelHandler : IChannelHandler
        {
            wrapper.NotNull(nameof(wrapper));

            return(wrapper.AddChannelHandlerAsync <ISocketChannel>(tlsCertificate, pipeline =>
            {
                pipeline.AddLast(new LoggingHandler());
                pipeline.AddLast(channelHandler);
            }));
        }
        public static IBootstrapWrapper AddFactorialHandler <TChannelHandler>(this IBootstrapWrapper wrapper,
                                                                              X509Certificate2 tlsCertificate, TChannelHandler channelHandler)
            where TChannelHandler : IChannelHandler
        {
            wrapper.NotNull(nameof(wrapper));

            return(wrapper.AddChannelHandlerAsync <ISocketChannel>(tlsCertificate, pipeline =>
            {
                pipeline.AddLast(new LoggingHandler("CONN"));
                pipeline.AddLast(new BigIntegerDecoder());
                pipeline.AddLast(new BigIntegerEncoder());
                pipeline.AddLast(channelHandler);
            }));
        }
        public static IBootstrapWrapper AddTelnetHandler <TChannelHandler>(this IBootstrapWrapper wrapper,
                                                                           X509Certificate2 tlsCertificate, TChannelHandler channelHandler)
            where TChannelHandler : IChannelHandler
        {
            wrapper.NotNull(nameof(wrapper));

            return(wrapper.AddChannelHandlerAsync <ISocketChannel>(tlsCertificate, pipeline =>
            {
                pipeline.AddLast(new DelimiterBasedFrameDecoder(8192, Delimiters.LineDelimiter()));
                pipeline.AddLast(new StringEncoder());
                pipeline.AddLast(new StringDecoder());
                pipeline.AddLast(channelHandler);
            }));
        }
        public static IBootstrapWrapper AddEchoHandler <TChannelHandler>(this IBootstrapWrapper wrapper,
                                                                         X509Certificate2 tlsCertificate, TChannelHandler channelHandler)
            where TChannelHandler : IChannelHandler
        {
            wrapper.NotNull(nameof(wrapper));

            return(wrapper.AddChannelHandlerAsync <ISocketChannel>(tlsCertificate, pipeline =>
            {
                pipeline.AddLast(new LoggingHandler());
                pipeline.AddLast("framing-enc", new LengthFieldPrepender(2));
                pipeline.AddLast("framing-dec", new LengthFieldBasedFrameDecoder(ushort.MaxValue, 0, 2, 0, 2));
                pipeline.AddLast("echo", channelHandler);
            },
                                                                   addTlsPipelineName: true));
        }
        public static IBootstrapWrapper AddWebSocketHandler <TChannelHandler>(this IBootstrapWrapper wrapper,
                                                                              X509Certificate2 tlsCertificate, TChannelHandler channelHandler)
            where TChannelHandler : IChannelHandler
        {
            wrapper.NotNull(nameof(wrapper));

            return(wrapper.AddChannelHandlerAsync <IChannel>(tlsCertificate, pipeline =>
            {
                pipeline.AddLast(
                    new HttpClientCodec(),
                    new HttpObjectAggregator(8192),
                    WebSocketClientCompressionHandler.Instance,
                    channelHandler);
            },
                                                             addTlsPipelineName: true));
        }