博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

WCF--maxConnections

Posted on 2007-10-17 16:23  江南白衣  阅读(2039)  评论(1编辑  收藏  举报

      <bindings>
        <netTcpBinding>
          <binding name="sharePortBinding" closeTimeout="00:02:00" receiveTimeout="00:05:00"
            sendTimeout="00:02:00" maxBufferPoolSize="524288000" maxBufferSize="655360000"
            maxConnections="1000" maxReceivedMessageSize="655360000" portSharingEnabled="true">
            <readerQuotas maxStringContentLength="655360000" />
          </binding>
        </netTcpBinding>
      </bindings>

      <services>
        <service behaviorConfiguration="AdventureWorksDLinqDemo.ProductServiceBehavior"
          name="AdventureWorksDLinqDemo.ProductService">
          <endpoint address="" binding="netTcpBinding" bindingConfiguration="sharePortBinding"
            name="ProductService" contract="AdventureWorksDLinqDemo.IProductService" />
          
          <endpoint address="net.tcp://localhost:5141/ProductService/MEX"
                    binding="mexTcpBinding"
                    contract="IMetadataExchange" />
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:5140/ProductService" />
            </baseAddresses>
            <timeouts closeTimeout="00:10:00" />
          </host>
        </service>
    </services>
=========================================================
maxConnections > 10的时候,服务会抛出EndpointNotFoundException异常。
解决方法:
              <endpoint address="net.tcp://localhost:5141/ProductService/MEX"
                    binding="mexTcpBinding"
                    contract="IMetadataExchange" />
修改mexTcpBinding的端口,不要与baseAddress的端口一样。