public ClientOutboundConnectionFactory(
     IOptions <ConnectionOptions> connectionOptions,
     IOptions <ClientConnectionOptions> clientConnectionOptions,
     ConnectionCommon connectionShared)
     : base(connectionShared.ServiceProvider.GetRequiredServiceByKey <object, IConnectionFactory>(ServicesKey), connectionShared.ServiceProvider, connectionOptions)
 {
     this.connectionShared        = connectionShared;
     this.clientConnectionOptions = clientConnectionOptions.Value;
 }
 protected ConnectionListener(
     IConnectionListenerFactory listenerFactory,
     IOptions <ConnectionOptions> connectionOptions,
     ConnectionManager connectionManager,
     ConnectionCommon connectionShared)
 {
     this.listenerFactory   = listenerFactory;
     this.connectionManager = connectionManager;
     this.ConnectionOptions = connectionOptions.Value;
     this.connectionShared  = connectionShared;
 }
Пример #3
0
 public SiloConnectionFactory(
     IServiceProvider serviceProvider,
     IOptions <ConnectionOptions> connectionOptions,
     IOptions <SiloConnectionOptions> siloConnectionOptions,
     ILocalSiloDetails localSiloDetails,
     ConnectionCommon connectionShared)
     : base(serviceProvider.GetRequiredServiceByKey <object, IConnectionFactory>(ServicesKey), serviceProvider, connectionOptions)
 {
     this.serviceProvider       = serviceProvider;
     this.siloConnectionOptions = siloConnectionOptions.Value;
     this.localSiloDetails      = localSiloDetails;
     this.connectionShared      = connectionShared;
 }
Пример #4
0
 public SiloConnection(
     SiloAddress remoteSiloAddress,
     ConnectionContext connection,
     ConnectionDelegate middleware,
     MessageCenter messageCenter,
     ILocalSiloDetails localSiloDetails,
     ConnectionManager connectionManager,
     ConnectionOptions connectionOptions,
     ConnectionCommon connectionShared)
     : base(connection, middleware, connectionShared)
 {
     this.messageCenter     = messageCenter;
     this.connectionManager = connectionManager;
     this.connectionOptions = connectionOptions;
     this.LocalSiloAddress  = localSiloDetails.SiloAddress;
     this.RemoteSiloAddress = remoteSiloAddress;
 }
Пример #5
0
        protected Connection(
            ConnectionContext connection,
            ConnectionDelegate middleware,
            ConnectionCommon shared)
        {
            this.Context               = connection ?? throw new ArgumentNullException(nameof(connection));
            this.middleware            = middleware ?? throw new ArgumentNullException(nameof(middleware));
            this.shared                = shared;
            this.outgoingMessages      = Channel.CreateUnbounded <Message>(OutgoingMessageChannelOptions);
            this.outgoingMessageWriter = this.outgoingMessages.Writer;

            // Set the connection on the connection context so that it can be retrieved by the middleware.
            this.Context.Features.Set <Connection>(this);

            this.RemoteEndPoint = NormalizeEndpoint(this.Context.RemoteEndPoint);
            this.LocalEndPoint  = NormalizeEndpoint(this.Context.LocalEndPoint);
        }
Пример #6
0
 public ClientOutboundConnection(
     SiloAddress remoteSiloAddress,
     ConnectionContext connection,
     ConnectionDelegate middleware,
     ClientMessageCenter messageCenter,
     ConnectionManager connectionManager,
     ConnectionOptions connectionOptions,
     ConnectionCommon connectionShared)
     : base(connection, middleware, connectionShared)
 {
     this.messageCenter          = messageCenter;
     this.connectionManager      = connectionManager;
     this.connectionOptions      = connectionOptions;
     this.remoteSiloAddress      = remoteSiloAddress ?? throw new ArgumentNullException(nameof(remoteSiloAddress));
     this.MessageReceivedCounter = MessagingStatisticsGroup.GetMessageReceivedCounter(this.remoteSiloAddress);
     this.MessageSentCounter     = MessagingStatisticsGroup.GetMessageSendCounter(this.remoteSiloAddress);
 }
Пример #7
0
 public SiloConnectionFactory(
     IServiceProvider serviceProvider,
     IOptions <ConnectionOptions> connectionOptions,
     IOptions <SiloConnectionOptions> siloConnectionOptions,
     ILocalSiloDetails localSiloDetails,
     ConnectionCommon connectionShared,
     ProbeRequestMonitor probeRequestMonitor,
     ConnectionPreambleHelper connectionPreambleHelper)
     : base(serviceProvider.GetRequiredServiceByKey <object, IConnectionFactory>(ServicesKey), serviceProvider, connectionOptions)
 {
     this.serviceProvider          = serviceProvider;
     this.siloConnectionOptions    = siloConnectionOptions.Value;
     this.localSiloDetails         = localSiloDetails;
     this.connectionShared         = connectionShared;
     this.probeRequestMonitor      = probeRequestMonitor;
     this.connectionPreambleHelper = connectionPreambleHelper;
 }
Пример #8
0
 public SiloConnectionListener(
     IServiceProvider serviceProvider,
     IOptions <ConnectionOptions> connectionOptions,
     IOptions <SiloConnectionOptions> siloConnectionOptions,
     MessageCenter messageCenter,
     IOptions <EndpointOptions> endpointOptions,
     ILocalSiloDetails localSiloDetails,
     ConnectionManager connectionManager,
     ConnectionCommon connectionShared)
     : base(serviceProvider.GetRequiredServiceByKey <object, IConnectionListenerFactory>(ServicesKey), connectionOptions, connectionManager, connectionShared)
 {
     this.siloConnectionOptions = siloConnectionOptions.Value;
     this.messageCenter         = messageCenter;
     this.localSiloDetails      = localSiloDetails;
     this.connectionManager     = connectionManager;
     this.connectionShared      = connectionShared;
     this.endpointOptions       = endpointOptions.Value;
 }
Пример #9
0
 public GatewayInboundConnection(
     ConnectionContext connection,
     ConnectionDelegate middleware,
     Gateway gateway,
     OverloadDetector overloadDetector,
     ILocalSiloDetails siloDetails,
     ConnectionOptions connectionOptions,
     MessageCenter messageCenter,
     ConnectionCommon connectionShared)
     : base(connection, middleware, connectionShared)
 {
     this.connectionOptions      = connectionOptions;
     this.gateway                = gateway;
     this.overloadDetector       = overloadDetector;
     this.siloDetails            = siloDetails;
     this.messageCenter          = messageCenter;
     this.loadSheddingCounter    = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_LOAD_SHEDDING);
     this.myAddress              = siloDetails.SiloAddress;
     this.MessageReceivedCounter = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_RECEIVED);
     this.MessageSentCounter     = CounterStatistic.FindOrCreate(StatisticNames.GATEWAY_SENT);
 }
Пример #10
0
        protected Connection(
            ConnectionContext connection,
            ConnectionDelegate middleware,
            ConnectionCommon shared)
        {
#if !NETCOREAPP
            this.handleMessageCallback = obj => this.OnReceivedMessage((Message)obj);
#endif
            this.Context               = connection ?? throw new ArgumentNullException(nameof(connection));
            this.middleware            = middleware ?? throw new ArgumentNullException(nameof(middleware));
            this.shared                = shared;
            this.outgoingMessages      = Channel.CreateUnbounded <Message>(OutgoingMessageChannelOptions);
            this.outgoingMessageWriter = this.outgoingMessages.Writer;

            // Set the connection on the connection context so that it can be retrieved by the middleware.
            this.Context.Features.Set <Connection>(this);

            this.RemoteEndPoint = NormalizeEndpoint(this.Context.RemoteEndPoint);
            this.LocalEndPoint  = NormalizeEndpoint(this.Context.LocalEndPoint);
            this.IsValid        = true;
        }
Пример #11
0
 public SiloConnection(
     SiloAddress remoteSiloAddress,
     ConnectionContext connection,
     ConnectionDelegate middleware,
     MessageCenter messageCenter,
     ILocalSiloDetails localSiloDetails,
     ConnectionManager connectionManager,
     ConnectionOptions connectionOptions,
     ConnectionCommon connectionShared,
     ProbeRequestMonitor probeMonitor,
     ConnectionPreambleHelper connectionPreambleHelper)
     : base(connection, middleware, connectionShared)
 {
     this.messageCenter            = messageCenter;
     this.connectionManager        = connectionManager;
     this.connectionOptions        = connectionOptions;
     this.probeMonitor             = probeMonitor;
     this.connectionPreambleHelper = connectionPreambleHelper;
     this.LocalSiloAddress         = localSiloDetails.SiloAddress;
     this.RemoteSiloAddress        = remoteSiloAddress;
 }
Пример #12
0
 public GatewayConnectionListener(
     IServiceProvider serviceProvider,
     IOptions <ConnectionOptions> connectionOptions,
     IOptions <SiloConnectionOptions> siloConnectionOptions,
     OverloadDetector overloadDetector,
     Gateway gateway,
     ILocalSiloDetails localSiloDetails,
     IOptions <MultiClusterOptions> multiClusterOptions,
     IOptions <EndpointOptions> endpointOptions,
     MessageCenter messageCenter,
     ConnectionManager connectionManager,
     ConnectionCommon connectionShared)
     : base(serviceProvider.GetRequiredServiceByKey <object, IConnectionListenerFactory>(ServicesKey), connectionOptions, connectionManager, connectionShared)
 {
     this.siloConnectionOptions = siloConnectionOptions.Value;
     this.overloadDetector      = overloadDetector;
     this.gateway             = gateway;
     this.localSiloDetails    = localSiloDetails;
     this.multiClusterOptions = multiClusterOptions;
     this.messageCenter       = messageCenter;
     this.connectionShared    = connectionShared;
     this.endpointOptions     = endpointOptions.Value;
 }