コード例 #1
0
 /// <summary>
 /// Initialises and returns a new NetTcp service client. This client should be used when the client is on a separate machine from the service.
 /// </summary>
 /// <param name="endpointUri">The uri where the NetTcp endpoint is running. By default this is net.tcp://{machinename}:8095/brightstar</param>
 /// <param name="queryCache">OPTIONAL : the cache to use for query results</param>
 /// <returns>A new brightstar service client. It is important to call dispose on the client after use.</returns>
 internal static IBrightstarService GetNetTcpClient(Uri endpointUri, ICache queryCache = null)
 {
     var binding = new NetTcpContextBinding
     {
         MaxReceivedMessageSize = Int32.MaxValue,
         SendTimeout = TimeSpan.FromMinutes(30),
         TransferMode = TransferMode.StreamedResponse,
         ReaderQuotas = XmlDictionaryReaderQuotas.Max
     };
     var endpointAddress = new EndpointAddress(endpointUri);
     var client = new BrightstarServiceClient(new BrightstarWcfServiceClient(binding, endpointAddress), queryCache);
     return client;
 }
コード例 #2
0
        /// <summary>
        /// Initialises and returns a new NetTcp service client. This client should be used when the client is on a separate machine from the service.
        /// </summary>
        /// <param name="endpointUri">The uri where the NetTcp endpoint is running. By default this is net.tcp://{machinename}:8095/brightstar</param>
        /// <param name="queryCache">OPTIONAL : the cache to use for query results</param>
        /// <returns>A new brightstar service client. It is important to call dispose on the client after use.</returns>
        internal static IBrightstarService GetNetTcpClient(Uri endpointUri, ICache queryCache = null)
        {
            var binding = new NetTcpContextBinding
            {
                MaxReceivedMessageSize = Int32.MaxValue,
                SendTimeout            = TimeSpan.FromMinutes(30),
                TransferMode           = TransferMode.StreamedResponse,
                ReaderQuotas           = XmlDictionaryReaderQuotas.Max
            };
            var endpointAddress = new EndpointAddress(endpointUri);
            var client          = new BrightstarServiceClient(new BrightstarWcfServiceClient(binding, endpointAddress), queryCache);

            return(client);
        }