public NamedPipeServer(IFormatter formatter, NamedPipeConfiguration configuration, ILogger <NamedPipeServer> logger) { _formatter = formatter; _configuration = configuration; _logger = logger; Regenerate(); }
public MessageHandler(IServiceProvider serviceProvider, IMessageChannel messageChannel, NamedPipeConfiguration configuration) { _serviceProvider = serviceProvider; _messageChannel = messageChannel; _configuration = configuration; messageChannel.MessageReceived += MessageChannel_MessageReceived; }
public ServerMessageChannel(IFormatter formatter, NamedPipeConfiguration configuration, ILoggerFactory loggerFactory, IConnectedClientFactory connectedClientFactory) { _configuration = configuration; _connectedClientFactory = connectedClientFactory; _logger = loggerFactory.CreateLogger <ServerMessageChannel>(); for (var i = 0; i < configuration.MaxServerInstances; i++) { var svr = new NamedPipeServer(formatter, configuration, loggerFactory.CreateLogger <NamedPipeServer>()); svr.ClientConnected += PipeServer_ClientConnected; svr.ClientDisconnected += PipeServer_ClientDisconnected; _pipeServers.Add(svr); } }
public static INamedPipeClientBuilder AddNamedPipeClient(this IServiceCollection serviceCollection, string pipeName, Action <NamedPipeConfiguration> configureOptions = null) { var builder = new NamedPipeClientBuilder(serviceCollection); var options = new NamedPipeConfiguration(pipeName); configureOptions?.Invoke(options); serviceCollection.AddLogging(); serviceCollection.AddSingleton(options); serviceCollection.AddSingleton <IMessageChannel, ClientMessageChannel>(); serviceCollection.AddSingleton <NamedPipeClient>(); serviceCollection.AddTransient <IFormatter, BinaryFormatter>(); serviceCollection.AddScoped <ICallContext, CallContext>(); serviceCollection.AddTransient <IMethodDispatcher, MethodDispatcher>(); serviceCollection.AddTransient <IProxyGenerator, ProxyGenerator>(); serviceCollection.AddTransient(typeof(ContractProxyGenerator <>)); serviceCollection.AddSingleton <IMessageHandler, MessageHandler>(); return(builder); }
public static IMessageBusOperator AddNamedPipeServer(this IMessageBusOperator @operator) { NamedPipeConfiguration.ServerInitialize(); return(@operator); }
public NamedPipeClient(NamedPipeConfiguration configuration, IFormatter formatter, ILogger <NamedPipeClient> logger) { _configuration = configuration; _formatter = formatter; _logger = logger; }