コード例 #1
0
        /// <summary>
        ///     Creates a service remoting client factory for connecting to the service over remoted service interfaces.
        /// </summary>
        /// <param name="callbackClient">
        ///     Client implementation where the callbacks should be dispatched.
        /// </param>
        /// <returns>
        ///     A <see cref="Microsoft.ServiceFabric.Services.Remoting.FabricTransport.Client.FabricTransportServiceRemotingClientFactory"/>
        ///     as <see cref="Microsoft.ServiceFabric.Services.Remoting.Client.IServiceRemotingClientFactory"/>
        ///     that can be used with <see cref="Microsoft.ServiceFabric.Services.Remoting.Client.ServiceProxyFactory"/> to
        ///     generate service proxy to talk to a stateless or stateful service over remoted actor interface.
        /// </returns>
        public override IServiceRemotingClientFactory CreateServiceRemotingClientFactory(
            IServiceRemotingCallbackClient callbackClient)
        {
            var settings = FabricTransportRemotingSettings.GetDefault();

            settings.MaxMessageSize   = this.GetAndValidateMaxMessageSize(settings.MaxMessageSize);
            settings.OperationTimeout = this.GetAndValidateOperationTimeout(settings.OperationTimeout);
            settings.KeepAliveTimeout = this.GetKeepAliveTimeout(settings.KeepAliveTimeout);
            settings.ConnectTimeout   = this.GetConnectTimeout(settings.ConnectTimeout);
            return(new FabricTransportServiceRemotingClientFactory(settings, callbackClient));
        }
コード例 #2
0
        /// <summary>
        ///     Creates a  V2 service remoting client factory for connecting to the service over remoted service interfaces.
        /// </summary>
        /// <param name="callbackMessageHandler">
        ///    The client implementation where the callbacks should be dispatched.
        /// </param>
        /// <returns>
        ///     A <see cref="FabricTransportServiceRemotingClientFactory"/>
        ///     as <see cref="V2.Client.IServiceRemotingClientFactory"/>
        ///     that can be used with <see cref="Remoting.Client.ServiceProxyFactory"/> to
        ///     generate service proxy to talk to a stateless or stateful service over remoted actor interface.
        /// </returns>

        public override V2.Client.IServiceRemotingClientFactory CreateServiceRemotingClientFactoryV2(
            IServiceRemotingCallbackMessageHandler callbackMessageHandler)
        {
            var settings = FabricTransportRemotingSettings.GetDefault();

            settings.MaxMessageSize   = this.GetAndValidateMaxMessageSize(settings.MaxMessageSize);
            settings.OperationTimeout = this.GetAndValidateOperationTimeout(settings.OperationTimeout);
            settings.KeepAliveTimeout = this.GetKeepAliveTimeout(settings.KeepAliveTimeout);
            settings.ConnectTimeout   = this.GetConnectTimeout(settings.ConnectTimeout);
            return(new V2.FabricTransport.Client.FabricTransportServiceRemotingClientFactory(remotingSettings: settings,
                                                                                             remotingCallbackMessageHandler: callbackMessageHandler));
        }