Пример #1
0
        public RpcTcpServer <TService> PublishSecured <TService>(
            TService serviceInstance,
            TimeSpan serviceShutdownTimeout,
            ServerSslSettings sslSettings)
        {
            var service = new RpcTcpServer <TService>(serviceInstance, serviceShutdownTimeout, sslSettings, _serializerFactory, _logger);

            service.Start();
            return(service);
        }
Пример #2
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);
 }
Пример #3
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;
 }