Exemple #1
0
 public static IIpcHostBuilder AddNamedPipeEndpoint <TContract>(this IIpcHostBuilder builder,
                                                                string pipeName)
     where TContract : class
 {
     return(builder.AddNamedPipeEndpoint <TContract>(options =>
     {
         options.PipeName = pipeName;
     }));
 }
Exemple #2
0
 public static IIpcHostBuilder AddTcpEndpoint <TContract>(this IIpcHostBuilder builder,
                                                          IPAddress ipEndpoint, int port)
     where TContract : class
 {
     return(builder.AddTcpEndpoint <TContract>(options =>
     {
         options.IpEndpoint = ipEndpoint;
         options.Port = port;
     }));
 }
Exemple #3
0
        public static IIpcHostBuilder AddTcpEndpoint <TContract>(this IIpcHostBuilder builder,
                                                                 Action <TcpIpcEndpointOptions> configure)
            where TContract : class
        {
            var options = new TcpIpcEndpointOptions();

            configure?.Invoke(options);

            builder.AddIpcEndpoint(serviceProvider =>
            {
                ILogger <TcpIpcEndpoint <TContract> > logger = serviceProvider
                                                               .GetRequiredService <ILogger <TcpIpcEndpoint <TContract> > >();

                return(new TcpIpcEndpoint <TContract>(options, logger, serviceProvider));
            });

            return(builder);
        }