• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ServiceModel.NetNamedPipeBinding类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ServiceModel.NetNamedPipeBinding的典型用法代码示例。如果您正苦于以下问题:C# NetNamedPipeBinding类的具体用法?C# NetNamedPipeBinding怎么用?C# NetNamedPipeBinding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NetNamedPipeBinding类属于System.ServiceModel命名空间,在下文中一共展示了NetNamedPipeBinding类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Inspect

 public string Inspect(ManagedApplicationInfo applicationInfo)
 {
     var binding = new NetNamedPipeBinding();
     var channelFactory = new ChannelFactory<IProcessService>(binding, ProcessServiceAddress);
     IProcessService processService = channelFactory.CreateChannel();
     return processService.Inspect(applicationInfo);
 }
开发者ID:bdurrani,项目名称:WPF-Inspector,代码行数:7,代码来源:Process32Service.cs


示例2: ReadyRemoteProcess

        private void ReadyRemoteProcess()
        {
            string uri = "net.pipe://localhost/download";

            DownloadManager dm = new DownloadManager();
            dm.CopyFileCallBack = delegate(string file)
            {
                return doCopyFile(file);
            };

            try
            {
                this.host = new ServiceHost(dm);

                NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
                host.AddServiceEndpoint(typeof(IDownloadManager), binding, uri);

                host.Open();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                this.host = null;
            }
        }
开发者ID:kirigishi123,项目名称:try_samples,代码行数:25,代码来源:Form1.cs


示例3: ServerAncClientExceptionsEndpointBehavior

        public void ServerAncClientExceptionsEndpointBehavior()
        {
            var hook = new ExceptionsEndpointBehaviour();
            var address = @"net.pipe://127.0.0.1/test" + this.GetType().Name + "_" + MethodBase.GetCurrentMethod().Name;
            var serv = new ExceptionService();
            using (var host = new ServiceHost(serv, new Uri[] { new Uri(address), }))
            {
                var b = new NetNamedPipeBinding();
                var serverEndpoint = host.AddServiceEndpoint(typeof(IExceptionService), b, address);
                serverEndpoint.Behaviors.Add(hook);

                host.Open();

                var f = new ChannelFactory<IExceptionService>(b);
                f.Endpoint.Behaviors.Add(hook);

                var c = f.CreateChannel(new EndpointAddress(address));

                try
                {
                    c.DoException("message");
                }
                catch (InvalidOperationException ex)
                {
                    StringAssert.AreEqualIgnoringCase("message", ex.Message);
                }
                host.Abort();
            }
        }
开发者ID:OpenSharp,项目名称:NDceRpc,代码行数:29,代码来源:ServiceEndpointBehavioursTests.cs


示例4: RunClientAsync

        private static async Task RunClientAsync(Uri address, CancellationToken token)
        {
            ClientEventSource eventSource = ClientEventSource.Instance;

            NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
            binding.OpenTimeout = TimeSpan.FromSeconds(1.0d);
            binding.SendTimeout = TimeSpan.FromSeconds(1.0d);
            binding.ReceiveTimeout = TimeSpan.FromSeconds(1.0d);
            binding.CloseTimeout = TimeSpan.FromSeconds(1.0d);

            CalculatorChannelFactory factory = new CalculatorChannelFactory(binding, new EndpointAddress(address), eventSource);
            await factory.OpenAsync();

            ConnectionManager<ICalculatorClientAsync> connectionManager = new ConnectionManager<ICalculatorClientAsync>(factory);

            using (ProxyInvoker<ICalculatorClientAsync> proxy = new ProxyInvoker<ICalculatorClientAsync>(connectionManager))
            {
                Random random = new Random();

                while (!token.IsCancellationRequested)
                {
                    try
                    {
                        await proxy.InvokeAsync(c => InvokeRandomAsync(random, c));
                    }
                    catch (Exception)
                    {
                    }

                    await Task.Delay(TimeSpan.FromMilliseconds(250.0d));
                }
            }

            await factory.CloseAsync();
        }
开发者ID:knightfall,项目名称:writeasync,代码行数:35,代码来源:Program.cs


示例5: TrySetColor

        private static bool TrySetColor(Color color)
        {
            try
            {
                const string uriText = "net.pipe://localhost/mailnotifier/sign";
                NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
                EndpointAddress endpointAddress = new EndpointAddress(uriText);
                using (MailNotifierServiceClient client = new MailNotifierServiceClient(binding, endpointAddress))
                {
                    byte red = color.R;
                    byte green = color.G;
                    byte blue = color.B;

                    client.SetColor(red, green, blue);

                    client.Close();
                    return true;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Failed to set color to " + color + ": " + e.Message);
                return false;
            }
        }
开发者ID:rpwjanzen,项目名称:blinken,代码行数:25,代码来源:Program.cs


示例6: CreateChannel

 public void CreateChannel()
 {
   Binding binding;
   EndpointAddress endpointAddress;
   bool useAuth = !string.IsNullOrEmpty(Username) && !string.IsNullOrEmpty(Password);
   if (IsLocal(ServerName))
   {
     endpointAddress = new EndpointAddress("net.pipe://localhost/MPExtended/TVAccessService");
     binding = new NetNamedPipeBinding { MaxReceivedMessageSize = 10000000 };
   }
   else
   {
     endpointAddress = new EndpointAddress(string.Format("http://{0}:4322/MPExtended/TVAccessService", ServerName));
     BasicHttpBinding basicBinding = new BasicHttpBinding { MaxReceivedMessageSize = 10000000 };
     if (useAuth)
     {
       basicBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
       basicBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
     }
     basicBinding.ReaderQuotas.MaxStringContentLength = 5*1024*1024; // 5 MB
     binding = basicBinding;
   }
   binding.OpenTimeout = TimeSpan.FromSeconds(5);
   ChannelFactory<ITVAccessService> factory = new ChannelFactory<ITVAccessService>(binding);
   if (factory.Credentials != null && useAuth)
   {
     factory.Credentials.UserName.UserName = Username;
     factory.Credentials.UserName.Password = Password;
   }
   TvServer = factory.CreateChannel(endpointAddress);
 }
开发者ID:BigGranu,项目名称:MediaPortal-2,代码行数:31,代码来源:SlimTVMPExtendedProvider.cs


示例7: Create

        // Public Creator
        public bool Create()
        {
            bool rc = false;
            try
            {
                _binding = new NetNamedPipeBinding();
                _binding.MaxReceivedMessageSize = 10485760;
                if (productId == 0)
                {
                    //_endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2013/LyrebirdService");
                }
                else if (productId == 2)
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2015/LyrebirdService");
                }
                else if (productId == 3)
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2016/LyrebirdService");
                }

                else
                {
                    _endpoint = new EndpointAddress("net.pipe://localhost/LMNts/LyrebirdServer/Revit2014/LyrebirdService");
                }
                _factory = new ChannelFactory<ILyrebirdService>(_binding, _endpoint);
                _channel = _factory.CreateChannel();
                
                rc = true;
            }
            catch (Exception ex)
            { 
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return rc;
        }
开发者ID:samuto,项目名称:Lyrebird,代码行数:36,代码来源:LyrebirdChannel.cs


示例8: CreateSession

		internal void CreateSession()
		{
			Uri serviceAddress = new Uri("net.pipe://localhost/Multitouch.Service/ApplicationInterface");
			EndpointAddress remoteAddress = new EndpointAddress(serviceAddress);
			NetNamedPipeBinding namedPipeBinding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
			namedPipeBinding.MaxReceivedMessageSize = int.MaxValue;
			namedPipeBinding.MaxBufferSize = int.MaxValue;
			namedPipeBinding.ReaderQuotas.MaxArrayLength = int.MaxValue;
			namedPipeBinding.ReceiveTimeout = TimeSpan.MaxValue;

			IApplicationInterfaceCallback dispatcher = new MultitouchServiceContactDispatcher(logic);
			InstanceContext instanceContext = new InstanceContext(dispatcher);
			service = new ApplicationInterfaceClient(instanceContext, namedPipeBinding, remoteAddress);

			try
			{
				service.CreateSession();
				MouseHelper.SingleMouseFallback = false;
			}
			catch (EndpointNotFoundException)
			{
				//throw new MultitouchException("Could not connect to Multitouch service, please start Multitouch input server before running this application.", e);
				Trace.TraceWarning("Could not connect to Multitouch service. Enabling single mouse input.");
				SingleMouseClientAndDispatcher client = new SingleMouseClientAndDispatcher(logic);
				service = client;
				dispatcher = client;
				MouseHelper.SingleMouseFallback = true;
			}
			contactDispatcher = dispatcher;
		}
开发者ID:zhuangfangwang,项目名称:ise,代码行数:30,代码来源:ServiceCommunicator.cs


示例9: OnStart

        protected override void OnStart(string[] args)
        {
            base.OnStart(args);

            if (this.serviceHost != null)
            {
                this.serviceHost.Close();
            }

            // start ServiceHost 
            var baseUri = new Uri(Prison.changeSessionBaseEndpointAddress);
            Uri serviceUri = baseUri;
            //Debugger.Launch();
            if (this.serviceId != null)
            {
                serviceUri = new Uri(Prison.changeSessionBaseEndpointAddress + "/" + this.serviceId);
            }

            var bind = new NetNamedPipeBinding();
            bind.Security.Mode = NetNamedPipeSecurityMode.Transport;
            bind.Security.Transport.ProtectionLevel = ProtectionLevel.EncryptAndSign;

            serviceHost = new ServiceHost(typeof(Executor), serviceUri);

            //serviceHost.Description.Behaviors.Add(new ServiceMetadataBehavior { HttpGetEnabled = false, HttpsGetEnabled = false });
            //serviceHost.Description.Behaviors.Find<ServiceDebugBehavior>().IncludeExceptionDetailInFaults = true;
            //serviceHost.Description.Behaviors.Find<ServiceDebugBehavior>().HttpHelpPageUrl = serviceUri;

            serviceHost.AddServiceEndpoint(typeof(IExecutor), bind, string.Empty);

            //this.serviceHost = new ServiceHost(typeof(Executor));

            this.serviceHost.Open();
        }
开发者ID:solakian,项目名称:windows-isolation,代码行数:34,代码来源:ChangeSessionWindowsService.cs


示例10: StartService

        public static IDisposable StartService(TestDetails testDetails, TestCallbackHandler testCallback)
        {
            if (_currentService != null)
            {
                _currentService.Dispose();
                _currentService = null;
            }

            _currentCallback = testCallback;
            _testDetails = testDetails;

            ServiceHost host = new ServiceHost(typeof(TestCallbackService));
            try
            {
                var binding = new NetNamedPipeBinding();
                binding.MaxReceivedMessageSize = 100000;
                host.AddServiceEndpoint(typeof(ITestCallbackService), binding, new Uri(ServiceAddress));
                host.Open();
            }
            catch (Exception)
            {
                ((IDisposable)host).Dispose();
                _currentCallback = null;
                throw;
            }
            return new ServiceWrapper(host);
        }
开发者ID:kiwidev,项目名称:testinjector,代码行数:27,代码来源:ServiceController.cs


示例11: Open

        public void Open(int port)
        {
            if (port < 0 || port > 65536)
                throw new ArgumentOutOfRangeException("port", "port value is invalid");

            string urlService = "net.pipe://localhost/" + SERVICE_NAME + "_" + port.ToString();

            lock (mClientLocker)
            {
                if (mProxy != null)
                    return;

                var bind = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
                bind.MaxReceivedMessageSize = 2147483647;
                bind.MaxBufferSize = 2147483647;
                // Commented next statement since it is not required
                bind.MaxBufferPoolSize = 2147483647;
                bind.ReaderQuotas.MaxArrayLength = 2147483647;
                bind.ReaderQuotas.MaxBytesPerRead = 2147483647;
                bind.ReaderQuotas.MaxDepth = 2147483647;
                bind.ReaderQuotas.MaxStringContentLength = 2147483647;
                bind.ReaderQuotas.MaxNameTableCharCount = 2147483647;

                mProxy = new MtApiProxy(new InstanceContext(this), bind, new EndpointAddress(urlService));
                mProxy.Faulted += mProxy_Faulted;
            }
        }
开发者ID:linyunfeng,项目名称:mtapi,代码行数:27,代码来源:MtClient.cs


示例12: CallbackToSyncContext

        public void CallbackToSyncContext()
        {
            var path = @"net.pipe://127.0.0.1/" + this.GetType().Name + MethodBase.GetCurrentMethod().Name;
            var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None) { MaxConnections = 5 };

            using (var server = new ServiceHost(new SyncCallbackService(), new Uri(path)))
            {

                server.AddServiceEndpoint(typeof(ISyncCallbackService), binding, path);

                server.Open();
                using (var syncContext = new StaSynchronizationContext())
                {
                    InstanceContext context = null;
                    DuplexChannelFactory<ISyncCallbackService> channelFactory = null;
                    ISyncCallbackService client = null;
                    syncContext.Send(_ => SynchronizationContext.SetSynchronizationContext(syncContext), null);
                    syncContext.Send(_ => context = new InstanceContext(new SyncCallbackServiceCallback()), null);
                    syncContext.Send(_ => channelFactory = new DuplexChannelFactory<ISyncCallbackService>(context, binding),null);
                    syncContext.Send(_ => client =  channelFactory.CreateChannel(new EndpointAddress(path)),null);
                    using (channelFactory)
                    {
                        var callbackThread = client.Call();
                        Assert.AreEqual(syncContext.ManagedThreadId, callbackThread);
                    }
                }

            }
        }
开发者ID:OpenSharp,项目名称:NDceRpc,代码行数:29,代码来源:SynchronizationTests.cs


示例13: InitChannel

 /// <summary>
 /// Creates a new client channel if the communication object is null or
 /// is faulted, closed or closing.
 /// </summary>
 private void InitChannel()
 {
     lock (_padlock)
     {
         if (_commObj == null || 
             (_commObj.State != CommunicationState.Opened &&
             _commObj.State != CommunicationState.Opening))
         {
             if (!string.IsNullOrEmpty(_configurationName))
             {
                 _client = new ChannelFactory<IProxyTraceService>(_configurationName).CreateChannel();
             }
             else
             {
                 // Todo - is None really the best choice of security mode?
                 // maybe we should secure the transport by default???
                 NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
                 EndpointAddress address = new EndpointAddress(DefaultEndpointAddress);
                 _client = ChannelFactory<IProxyTraceService>.CreateChannel(binding, address);
                 
             }
             _commObj = (ICommunicationObject)_client;
         }
     }
 }
开发者ID:Balansir,项目名称:Backload,代码行数:29,代码来源:ProxyTraceListener.cs


示例14: Start

        internal void Start() 
        {
            //Create a proxy to the event service
            EndpointAddress remoteAddress = new EndpointAddress(Config.Communincation.ServiceURI);
            NetNamedPipeBinding netNamedPipeBinding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
            IChannelFactory<IEventService> channelFactory = new ChannelFactory<IEventService>(netNamedPipeBinding, remoteAddress);
            IEventService eventService = channelFactory.CreateChannel(remoteAddress);
            
            //Signal ready and wait for other threads to join.
            _syncStartBarrier.SignalAndWait();

            EventSource eventSource = new EventSource() { ID = Guid.NewGuid(), Name = string.Format("Publisher:{0}", _Id) };
            Console.WriteLine("{0} Running...", eventSource);

            Event @event = new Event() { Source = eventSource, Info = String.Format("EVENT PUBLISHED AT[{0}]", DateTime.Now.ToLongTimeString()), RecordedAt = DateTime.Now };
            Byte[] bytes = ProtoBufSerializer.Serialize<Event>(@event);

            //Start publishing events
            for (Int64 i = 0; i < _iterations; i++)
            {
                eventService.Handle(bytes);
            }

            channelFactory.Close();
        }
开发者ID:KrishnanSrinivasan,项目名称:Disruptor-net-v1.1.0-With-WCF,代码行数:25,代码来源:EventPublisher.cs


示例15: Open_Open_error

        public void Open_Open_error()
        {
            var tcp= new NetTcpBinding();
            var pipe = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);

            Assert.IsTrue(tcp.Security.GetType() != pipe.Security.GetType());
        }
开发者ID:OpenSharp,项目名称:NDceRpc,代码行数:7,代码来源:SecurityTests.cs


示例16: Integration_test_zip_code_retrieval

        public void Integration_test_zip_code_retrieval()
        {
            string address = "net.pipe://localhost/GeoService";
            System.ServiceModel.Channels.Binding binding = new NetNamedPipeBinding();

            ServiceHost host = new ServiceHost(typeof(GeoManager));
            host.AddServiceEndpoint(typeof(IGeoService), binding, address);

            //Set IncludeExceptionDetailInFaults to true in code for WCF
            //This would however require that you self-host the WCF service - won't work in IIS hosting scenarios:
            ServiceDebugBehavior debug = host.Description.Behaviors.Find<ServiceDebugBehavior>();
            // if not found - add behavior with setting turned on
            if (debug == null)
            {
                host.Description.Behaviors.Add(
                     new ServiceDebugBehavior() { IncludeExceptionDetailInFaults = true });
            }
            else
            {
                // make sure setting is turned ON
                if (!debug.IncludeExceptionDetailInFaults)
                {
                    debug.IncludeExceptionDetailInFaults = true;
                }
            }
            host.Open();

            ChannelFactory<IGeoService> factory = new ChannelFactory<IGeoService>(
                binding, new EndpointAddress(address));
            IGeoService proxy = factory.CreateChannel();
            ZipCodeData data = proxy.GetZipInfo("07035");

            Assert.IsTrue(data.City.ToUpper() == "LINCOLN PARK");
            Assert.IsTrue(data.State == "NJ");
        }
开发者ID:iimrankhan,项目名称:WcfEndToEnd,代码行数:35,代码来源:ServiceTest.cs


示例17: NamedPipe_byteArray

        public void NamedPipe_byteArray()
        {
            using (var server = new ServiceHost(new Service(), new Uri("net.pipe://127.0.0.1/testpipename")))
            {
                var binding = new NetNamedPipeBinding {MaxConnections = 5};
                server.AddServiceEndpoint(typeof(IService),binding, "net.pipe://127.0.0.1/testpipename");
                server.Open();
                Thread.Sleep(100);
                using (var channelFactory = new ChannelFactory<IService>(binding))
                {

                    var client = channelFactory.CreateChannel(new EndpointAddress("net.pipe://127.0.0.1/testpipename"));
                    client.Execute(new byte[0]);

                    byte[] bytes = new byte[512];
                    new Random().NextBytes(bytes);

                    Stopwatch timer = new Stopwatch();
                    timer.Start();

                    for (int i = 0; i < 5000; i++)
                        client.Execute(bytes);

                    timer.Stop();
                    Trace.WriteLine(timer.ElapsedMilliseconds.ToString()+ " ms", MethodBase.GetCurrentMethod().Name);
                }
            }
        }
开发者ID:OpenSharp,项目名称:NDceRpc,代码行数:28,代码来源:PerformanceTests.cs


示例18: CreateServiceModel

		private ReportServicePreviewModel CreateServiceModel()
		{
			var url = "net.pipe://127.0.0.1/ReportFiresecService/";
			var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
			binding.OpenTimeout = TimeSpan.FromMinutes(10);
			binding.SendTimeout = TimeSpan.FromMinutes(10);
			binding.ReceiveTimeout = TimeSpan.FromMinutes(10);
			binding.MaxReceivedMessageSize = Int32.MaxValue;
			binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;
			binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
			binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue;
			binding.ReaderQuotas.MaxDepth = Int32.MaxValue;
			binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;
			binding.Security.Mode = NetNamedPipeSecurityMode.None;

			var endpoint = new EndpointAddress(url);
			var factory = new ReportServiceClientFactory(endpoint, binding);
			return new ReportServicePreviewModel()
			{
				ServiceClientFactory = factory,
				IsParametersPanelVisible = false,
				AutoShowParametersPanel = false,
				IsDocumentMapVisible = false,
				ZoomMode = new ZoomFitModeItem(ZoomFitMode.WholePage),
			};
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:26,代码来源:MainWindow.xaml.cs


示例19: CallAsync_wait_done

        public void CallAsync_wait_done()
        {
            var address = @"net.pipe://127.0.0.1/" + this.GetType().Name + "_" + MethodBase.GetCurrentMethod().Name;
            var binding = new NetNamedPipeBinding();

            var done = new ManualResetEvent(false);
            var srv = new AsyncService(done);
            var callback = new AsyncServiceCallback();

            using (var host = new ServiceHost(srv, new Uri(address)))
            {
                host.AddServiceEndpoint(typeof(IAsyncService), binding, address);
                host.Open();

                ThreadPool.QueueUserWorkItem(_ =>
                    {
                        using (var factory = new DuplexChannelFactory<IAsyncService>(new InstanceContext(callback), binding))
                        {
                            var client = factory.CreateChannel(new EndpointAddress(address));
                            AsyncCallback act = (x) =>
                            {
                                Assert.AreEqual(x.AsyncState, 1);
                            };
                            var result = client.BeginServiceAsyncMethod(act, 1);
                            result.AsyncWaitHandle.WaitOne();
                            Assert.AreEqual(result.AsyncState, 1);
                            client.EndServiceAsyncMethod(result);

                        }
                    });

                done.WaitOne();
            }
        }
开发者ID:OpenSharp,项目名称:NDceRpc,代码行数:34,代码来源:AsyncTests.cs


示例20: CreateServiceHost

        public ServiceHost CreateServiceHost(ClusterConfiguration clusterConfiguration)
        {
            var managerNode = new ManagerNode(clusterConfiguration);
            managerNode.Start();
            var serviceHost = new ServiceHost(managerNode,
                                              new[]
                                                  {
                                                      new Uri(string.Format("http://localhost:{0}/brightstarcluster",
                                                                            Configuration.HttpPort)),
                                                      new Uri(string.Format("net.tcp://localhost:{0}/brightstarcluster",
                                                                            Configuration.TcpPort)),
                                                      new Uri(string.Format("net.pipe://localhost/{0}",
                                                                            Configuration.NamedPipeName))
                                                  });

            var basicHttpBinding = new BasicHttpContextBinding { TransferMode = TransferMode.StreamedResponse, MaxReceivedMessageSize = int.MaxValue, SendTimeout = TimeSpan.FromMinutes(30), ReaderQuotas = XmlDictionaryReaderQuotas.Max, Namespace = "http://www.networkedplanet.com/schemas/brightstar" };
            var netTcpContextBinding = new NetTcpContextBinding { TransferMode = TransferMode.StreamedResponse, MaxReceivedMessageSize = int.MaxValue, SendTimeout = TimeSpan.FromMinutes(30), ReaderQuotas = XmlDictionaryReaderQuotas.Max, Namespace = "http://www.networkedplanet.com/schemas/brightstar" };
            var netNamedPipeBinding = new NetNamedPipeBinding { TransferMode = TransferMode.StreamedResponse, MaxReceivedMessageSize = int.MaxValue, SendTimeout = TimeSpan.FromMinutes(30), ReaderQuotas = XmlDictionaryReaderQuotas.Max, Namespace = "http://www.networkedplanet.com/schemas/brightstar" };

            serviceHost.AddServiceEndpoint(typeof(IBrightstarClusterManagerService), basicHttpBinding, "");
            serviceHost.AddServiceEndpoint(typeof(IBrightstarClusterManagerService), netTcpContextBinding, "");
            serviceHost.AddServiceEndpoint(typeof(IBrightstarClusterManagerService), netNamedPipeBinding, "");

            var throttlingBehavior = new ServiceThrottlingBehavior { MaxConcurrentCalls = int.MaxValue };

            serviceHost.Description.Behaviors.Add(new ServiceMetadataBehavior { HttpGetEnabled = true });
            serviceHost.Description.Behaviors.Add(throttlingBehavior);

            serviceHost.Closed += StopNode;
            return serviceHost;
            
        }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:32,代码来源:ClusterManagerServiceHostFactory.cs



注:本文中的System.ServiceModel.NetNamedPipeBinding类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ServiceModel.NetTcpBinding类代码示例发布时间:2022-05-26
下一篇:
C# ServiceModel.InstanceContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap