Esempio n. 1
0
 public RpcTcpServer(
     TService serviceInstance,
     TimeSpan serviceShutdownTimeout,
     ServerSslSettings sslSettings,
     ISerializerFactory serializerFactory,
     ILogger logger)
 {
     _serviceDispatcher      = new ServiceDispatcher <TService>(serializerFactory, logger);
     _serviceInstance        = serviceInstance;
     _serviceShutdownTimeout = serviceShutdownTimeout;
     _sslSettings            = sslSettings;
     _logger                      = logger;
     _messageSerializer           = serializerFactory.CreateSerializer <RpcMessage>();
     _serviceCallResultSerializer = serializerFactory.CreateSerializer <ServiceCallResult>();
     _listenerWaitHandle          = new AutoResetEvent(false);
     _tcpListener                 = new TcpListener(IPAddress.Any, _serviceDispatcher.ServicePort);
 }
Esempio n. 2
0
 public ClientHandler(
     TcpClient client,
     TService serviceInstance,
     ServerSslSettings sslSettings,
     ISerializer <RpcMessage> messageSerializer,
     ISerializer <ServiceCallResult> serviceCallResultSerializer,
     ServiceDispatcher <TService> serviceDispatcher,
     ILogger logger)
 {
     _client                      = client;
     _serviceInstance             = serviceInstance;
     _sslSettings                 = sslSettings;
     _messageSerializer           = messageSerializer;
     _serviceDispatcher           = serviceDispatcher;
     _logger                      = logger;
     _serviceCallResultSerializer = serviceCallResultSerializer;
 }