Beispiel #1
0
        public static ServerBuilder UseSockets(this ServerBuilder serverBuilder, Action <SocketsServerBuilder> configure)
        {
            var socketsBuilder = new SocketsServerBuilder();

            configure(socketsBuilder);
            socketsBuilder.Apply(serverBuilder);
            return(serverBuilder);
        }
        public static ServerBuilder Listen(this ServerBuilder builder, EndPoint endPoint, IConnectionListenerFactory connectionListenerFactory, Action <IConnectionBuilder> configure)
        {
            var connectionBuilder = new ConnectionBuilder(builder.ApplicationServices);

            configure(connectionBuilder);
            builder.Bindings.Add(new EndPointBinding(endPoint, connectionBuilder.Build(), connectionListenerFactory));
            return(builder);
        }
 public static ServerBuilder Listen <TTransport>(this ServerBuilder builder, EndPoint endPoint, Action <IConnectionBuilder> configure) where TTransport : IConnectionListenerFactory
 {
     return(builder.Listen(endPoint, ActivatorUtilities.CreateInstance <TTransport>(builder.ApplicationServices), configure));
 }
 internal Server(ServerBuilder builder)
 {
     _shutdownTcs = new TaskCompletionSource <object>(TaskCreationOptions.RunContinuationsAsynchronously);
     _logger      = builder.ApplicationServices.GetLoggerFactory().CreateLogger <Server>();
     _builder     = builder;
 }