【发布时间】:2013-12-02 12:21:20
【问题描述】:
我有一个用 .net 4 编写的 WCF 服务,并通过 net.tcp 公开。每当我尝试将绑定配置的 MaxConnections 属性设置为高于 10 的时候,我就是 AddressAlreadyInUseException。
为什么会在 MaxConnection 设置中出现这种情况?
(如果重要的话,我使用的是具有 4 核 CPU 和 4 GB 内存的 Server 2008 R2 Standard)
<binding name="NetTcpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transferMode="Buffered" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxBufferSize="25000000"
maxReceivedMessageSize="25000000" maxConnections="50">
<readerQuotas maxDepth="32" maxStringContentLength="25000000"
maxArrayLength="25000000" maxBytesPerRead="25000000" maxNameTableCharCount="25000000" />
<security mode="None" />
</binding>
<service behaviorConfiguration="ApiService.ServiceBehavior" name="Api.Service.PlatformApiService">
<endpoint
address="/Search"
binding="netTcpBinding"
bindingConfiguration="NetTcpBinding"
contract="IApiService" />
<endpoint
address="mex"
binding="mexTcpBinding"
bindingConfiguration="NetTcpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8094/Api/" />
</baseAddresses>
</host>
</service>
【问题讨论】: