public ProtoConnectionMiddleware(IList <IConnectionAdapter> adapters, ServiceContext serviceContext, IProtoApplication <TContext> application, ProtoProtocols protocols)
        {
            _serviceContext = serviceContext;
            _application    = application;
            _protocols      = protocols;

            // Keeping these around for now so progress can be made without updating tests
            _connectionAdapters = adapters;
        }
        public static IConnectionBuilder UseProtoServer <TContext>(this IConnectionBuilder builder, IList <IConnectionAdapter> adapters, ServiceContext serviceContext, IProtoApplication <TContext> application, ProtoProtocols protocols)
        {
            var middleware = new ProtoConnectionMiddleware <TContext>(adapters, serviceContext, application, protocols);

            return(builder.Use(next =>
            {
                return middleware.OnConnectionAsync;
            }));
        }
 public static IConnectionBuilder UseProtoServer <TContext>(this IConnectionBuilder builder, ServiceContext serviceContext, IProtoApplication <TContext> application, ProtoProtocols protocols)
 {
     return(builder.UseProtoServer(Array.Empty <IConnectionAdapter>(), serviceContext, application, protocols));
 }