开发者

WCF .net TCP service fails to start when extra properties are set

开发者 https://www.devze.com 2022-12-31 08:32 出处:网络
I have a current project that runs fine with a self-hosted net.tcp binding if I use the following host.AddServiceEndpoint(typeof(IMonitorService), new NetTcpBinding() {PortSharingEnabled = false}, \"

I have a current project that runs fine with a self-hosted net.tcp binding if I use the following

host.AddServiceEndpoint(typeof(IMonitorService), new NetTcpBinding() {PortSharingEnabled = false  }, "");
host.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexTcpBindin开发者_Go百科g(), "mex");

However, if I amend to the below it fails to run with the message that there is already an endpoint on the port, can anyone explain why adding the extra properties causes it to fail?

host.AddServiceEndpoint(typeof(IMonitorService), new NetTcpBinding() {PortSharingEnabled = false,ListenBacklog=1000,ReceiveTimeout=new TimeSpan(0,3,0)  }, "");
host.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexTcpBinding(), "mex");

Edit:

Testing confirms that the ReceiveTimeout property works Ok, as soon as I add the MaxConnections or ListenBacklog the service fails to start

Edit 2:

This link seems to imply I need port sharing if I want to modify these properties, not sure I am understanding it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号