public ServiceFabricRemotingClientConnection(string serviceUrl, ICommunicationModuleRegistry mods)
        {
            this.m_modules = mods;
            var proxyFactory = new ServiceProxyFactory(c => new FabricTransportServiceRemotingClientFactory());
            var rng          = new Random();

            this.m_svcProxy = proxyFactory.CreateServiceProxy <ITrinityOverRemotingService>(
                new Uri(serviceUrl),
                new Microsoft.ServiceFabric.Services.Client.ServicePartitionKey(rng.Next()),
                listenerName: Constants.c_RemotingListenerName);
        }
예제 #2
0
        // Overloaded Service Fabric RemRemoting Client Connection so that the user can
        // supply their own partition key.
        /// <summary>
        ///
        /// </summary>
        /// <param name="serviceUrl"></param>
        /// <param name="mods"></param>
        /// <param name="userPartitionKey"></param>
        public ServiceFabricRemotingClientConnection(string serviceUrl,
                                                     ICommunicationModuleRegistry mods,
                                                     ServicePartitionKey userPartitionKey = null)
        {
            m_userSuppliedPartitionKey = userPartitionKey ?? new ServicePartitionKey(new Random().Next());

            this.m_modules = mods;

            ServiceProxyFactory proxyFactory = new ServiceProxyFactory(serviceRemotingFactory => new FabricTransportServiceRemotingClientFactory());

            this.m_svcProxy = proxyFactory.CreateServiceProxy <ITrinityOverRemotingService>(new Uri(serviceUrl),
                                                                                            m_userSuppliedPartitionKey,
                                                                                            listenerName: Constants.c_RemotingListenerName);
        }