wcf net.tcp service fails to start when extra properties are set

Posted by Pharabus on Stack Overflow See other posts from Stack Overflow or by Pharabus
Published on 2010-05-25T16:53:38Z Indexed on 2010/05/26 14:01 UTC
Read the original article Hit count: 168

Filed under:
|

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

host.AddServiceEndpoint(typeof(IMonitorService), new NetTcpBinding() {PortSharingEnabled = false  }, "");
host.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexTcpBinding(), "mex");

however if I ammend 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 start

Edit 2:

this link seems to imply i ned portsharing is i want to modify these properies, not sure I am understanding it.

© Stack Overflow or respective owner

Related posts about c#

Related posts about wcf