使用 customBinding 时的 AddressAlreadyInUseException 而不是使用 netTcpBinding 时 [英] AddressAlreadyInUseException when using customBinding but not when using netTcpBinding

查看:18
本文介绍了使用 customBinding 时的 AddressAlreadyInUseException 而不是使用 netTcpBinding 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 leasTimeout 设置是 connectionPoolSettings 元素的一部分.我知道 connectionPoolSettings 是 tcpTransport 的子项.看起来这只能配置为 customBinding 而不是 netTcpBinding

I know that the leasTimeout settings are part of the connectionPoolSettings element. I know that connectionPoolSettings is a child of tcpTransport. It looks like this can be configured only as a customBinding and not a netTcpBinding

当我从 netTcpBinding 切换到 customBinding 时,我收到错误消息IP 端点 0.0.0.0:8091 上已经有一个侦听器.请确保您没有尝试在应用程序中多次使用此端点,并且有没有其他应用程序在此端点上侦听."

When I switch from netTcpBinding to customBinding, I get error messages about "There is already a listener on IP endpoint 0.0.0.0:8091. Make sure that you are not trying to use this endpoint multiple times in your application and that there are no other applications listening on this endpoint."

端口规格没有变化.

这是我的 netTcpBinding 配置:

Here is my netTcpBinding configuration:

  <netTcpBinding>
    <binding name="TcpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxConnections="10" maxReceivedMessageSize="100000000">
      <readerQuotas maxNameTableCharCount="1000000" maxStringContentLength="8192000" maxArrayLength="1638400" />
      <security mode="None">
      </security>
    </binding>
</netTcpBinding>

这是我的自定义绑定:

<customBinding>
    <binding name="TcpBindingCustom">
      <windowsStreamSecurity ProtectionLevel="None" />
      <tcpTransport>
        <connectionPoolSettings GroupName="default" leaseTimeout="00:05:00"
            idleTimeout="00:02:00" MaxOutboundConnectionsPerEndpoint="20" />
      </tcpTransport>
    </binding>
  </customBinding>

只有在使用 customBinding 时才使用 netTcpBinding 时才收到此错误消息.

I do not get this error message when using netTcpBinding only when using the customBinding.

我还确定,如果我注释掉 mex 端点,我不会收到此错误消息,但这并不能解决问题,但可能会帮助我们找到解决方案.

I have also determined that I do not get this error message if I comment out the mex endpoint, but that does not solve the problem but maybe it will help us find a solution.

推荐答案

不是问题的答案,而是当您的应用程序占用大量内存时可能会在未来拯救您的评论.您已将 maxBufferPoolSize 设置为 524288 并将 maxReceivedMessageSize 设置为 100000000 (752MB),这可能意味着(取决于您设置应用程序池的方式)您可以拥有 524288 个缓存缓冲区,每个缓冲区的大小为 100000000 (752MB)!最近,我们的服务(在 iis7 上运行)遇到了一个问题,即占用 1GB 内存.这是由于设置 maxBufferPoolSize 指定了可以缓存的最大缓冲区数.数字高达 524288,你是在给自己惹麻烦.我们已将此设置为较低的数字,但您需要考虑平衡,因为它会影响速度.在任何情况下,我都不会使用那么大的 maxReceivedMessageSize 将它设置为超过几个!(它需要那么大吗?) - 无论如何,这只是一个提示,可以节省您数天的内存分析和头疼!

Not an anwser to the question but a comment that might save you in the future when you app is holding onto a huge amount of memeory. You have set maxBufferPoolSize to 524288 and maxReceivedMessageSize to 100000000 (752MBs) which potential means (depending on how you have you app pool setup) that you could have 524288 cached buffers each with a size of 100000000 (752MB)! We recently had a problem with our service (running on iis7) holding on to 1GB of memory. This was due to the setting maxBufferPoolSize which specifys the max number of buffers that can be cached. With a number as high a 524288 you are setting yourself up for trouble. We have set this to a lower number but you need to think a balance as it will affect the speed. In any case I would not set it past a few with a maxReceivedMessageSize that large! (does it need to be that large?) - anyway just a tip to save you days of memory profiling and head scratching!

这篇关于使用 customBinding 时的 AddressAlreadyInUseException 而不是使用 netTcpBinding 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆