コード例 #1
0
        public TcpService(IPublisher publisher,
                          IPEndPoint serverEndPoint,
                          IPublisher networkSendQueue,
                          TcpServiceType serviceType,
                          TcpSecurityType securityType,
                          Func <Guid, IPEndPoint, ITcpDispatcher> dispatcherFactory,
                          TimeSpan heartbeatInterval,
                          TimeSpan heartbeatTimeout,
                          IAuthenticationProvider authProvider,
                          X509Certificate certificate,
                          int connectionPendingSendBytesThreshold)
        {
            Ensure.NotNull(publisher, "publisher");
            Ensure.NotNull(serverEndPoint, "serverEndPoint");
            Ensure.NotNull(networkSendQueue, "networkSendQueue");
            Ensure.NotNull(dispatcherFactory, "dispatcherFactory");
            Ensure.NotNull(authProvider, "authProvider");
            if (securityType == TcpSecurityType.Secure)
            {
                Ensure.NotNull(certificate, "certificate");
            }

            _publisher         = publisher;
            _serverEndPoint    = serverEndPoint;
            _serverListener    = new TcpServerListener(_serverEndPoint);
            _networkSendQueue  = networkSendQueue;
            _serviceType       = serviceType;
            _securityType      = securityType;
            _dispatcherFactory = dispatcherFactory;
            _heartbeatInterval = heartbeatInterval;
            _heartbeatTimeout  = heartbeatTimeout;
            _connectionPendingSendBytesThreshold = connectionPendingSendBytesThreshold;
            _authProvider = authProvider;
            _certificate  = certificate;
        }
コード例 #2
0
ファイル: TcpService.cs プロジェクト: jijiechen/SimpleSocket
        public TcpService(IPEndPoint serverEndPoint, X509Certificate certificate)
        {
            Ensure.NotNull(serverEndPoint, nameof(serverEndPoint));

            _serverEndPoint = serverEndPoint;
            _serverListener = new TcpServerListener(_serverEndPoint);
            _certificate    = certificate;
            _securityType   = certificate == null ? TcpSecurityType.Normal : TcpSecurityType.Secure;
        }
コード例 #3
0
ファイル: TcpService.cs プロジェクト: dhanzhang/EventStore
 public TcpService(IPublisher publisher,
                   IPEndPoint serverEndPoint,
                   IPublisher networkSendQueue,
                   TcpServiceType serviceType,
                   TcpSecurityType securityType,
                   ITcpDispatcher dispatcher,
                   TimeSpan heartbeatInterval,
                   TimeSpan heartbeatTimeout,
                   IAuthenticationProvider authProvider,
                   X509Certificate certificate)
     : this(publisher, serverEndPoint, networkSendQueue, serviceType, securityType, (_, __) => dispatcher,
            heartbeatInterval, heartbeatTimeout, authProvider, certificate)
 {
 }
コード例 #4
0
ファイル: TcpService.cs プロジェクト: matsnd/EventStore
 public TcpService(IPublisher publisher,
                   IPEndPoint serverEndPoint,
                   IPublisher networkSendQueue,
                   TcpServiceType serviceType,
                   TcpSecurityType securityType,
                   ITcpDispatcher dispatcher,
                   TimeSpan heartbeatInterval,
                   TimeSpan heartbeatTimeout,
                   IAuthenticationProvider authProvider,
                   X509Certificate certificate,
                   int connectionPendingSendBytesThreshold,
                   int connectionQueueSizeThreshold)
     : this(publisher, serverEndPoint, networkSendQueue, serviceType, securityType, (_, __) => dispatcher,
            heartbeatInterval, heartbeatTimeout, authProvider, certificate, connectionPendingSendBytesThreshold, connectionQueueSizeThreshold)
 {
 }
コード例 #5
0
 public TcpService(IPublisher publisher,
                   IPEndPoint serverEndPoint,
                   IPublisher networkSendQueue,
                   TcpServiceType serviceType,
                   TcpSecurityType securityType,
                   ITcpDispatcher dispatcher,
                   TimeSpan heartbeatInterval,
                   TimeSpan heartbeatTimeout,
                   IAuthenticationProvider authProvider,
                   AuthorizationGateway authorizationGateway,
                   X509Certificate certificate,
                   Func <X509Certificate, X509Chain, SslPolicyErrors, ValueTuple <bool, string> > sslClientCertValidator,
                   int connectionPendingSendBytesThreshold,
                   int connectionQueueSizeThreshold)
     : this(publisher, serverEndPoint, networkSendQueue, serviceType, securityType, (_, __) => dispatcher,
            heartbeatInterval, heartbeatTimeout, authProvider, authorizationGateway, certificate, sslClientCertValidator, connectionPendingSendBytesThreshold, connectionQueueSizeThreshold)
 {
 }
コード例 #6
0
        public TcpService(IPublisher publisher,
                          IPEndPoint serverEndPoint,
                          IPublisher networkSendQueue,
                          TcpServiceType serviceType,
                          TcpSecurityType securityType,
                          Func <Guid, IPEndPoint, ITcpDispatcher> dispatcherFactory,
                          TimeSpan heartbeatInterval,
                          TimeSpan heartbeatTimeout,
                          IAuthenticationProvider authProvider,
                          AuthorizationGateway authorizationGateway,
                          X509Certificate certificate,
                          Func <X509Certificate, X509Chain, SslPolicyErrors, ValueTuple <bool, string> > sslClientCertValidator,
                          int connectionPendingSendBytesThreshold,
                          int connectionQueueSizeThreshold)
        {
            Ensure.NotNull(publisher, "publisher");
            Ensure.NotNull(serverEndPoint, "serverEndPoint");
            Ensure.NotNull(networkSendQueue, "networkSendQueue");
            Ensure.NotNull(dispatcherFactory, "dispatcherFactory");
            Ensure.NotNull(authProvider, "authProvider");
            Ensure.NotNull(authorizationGateway, "authorizationGateway");
            if (securityType == TcpSecurityType.Secure)
            {
                Ensure.NotNull(certificate, "certificate");
            }

            _publisher         = publisher;
            _serverEndPoint    = serverEndPoint;
            _serverListener    = new TcpServerListener(_serverEndPoint);
            _networkSendQueue  = networkSendQueue;
            _serviceType       = serviceType;
            _securityType      = securityType;
            _dispatcherFactory = dispatcherFactory;
            _heartbeatInterval = heartbeatInterval;
            _heartbeatTimeout  = heartbeatTimeout;
            _connectionPendingSendBytesThreshold = connectionPendingSendBytesThreshold;
            _connectionQueueSizeThreshold        = connectionQueueSizeThreshold;
            _authProvider           = authProvider;
            _authorizationGateway   = authorizationGateway;
            _certificate            = certificate;
            _sslClientCertValidator = sslClientCertValidator;
        }