WCF MaxPendingChannels设置与MaxConnections

时间:2018-12-31 20:07:33

标签: wcf duplex

这些属性之间的关系是什么?其中哪一个控制着连接到net.tcp可靠服务的客户端数量?

我试图同时阅读它们两个,但是山雀不清楚,该控制哪个来限制服务

2 个答案:

答案 0 :(得分:1)

希望这会有所帮助。

MaxPendingChannels与可以通过可靠会话连接到服务的客户端数量有关。

When the sender creates a reliable session channel to a receiver, a handshake between them establishes a reliable session. After the reliable session is established, the channel is put in a pending channel queue for acceptance by the service. The MaxPendingChannels property indicates how many channels can be in this state.

MaxConnection行为取决于是在客户端还是在服务器上设置的:在客户端上,这是对池化连接的限制,在服务器上,是对尚未被ServiceModel接受的连接的限制层ref

答案 1 :(得分:1)

在我看来,此属性描述的是同一件事,即客户端可以同时连接的通道数。唯一的不同是,WCF服务的默认Concurrencymode为concurrencymode.single,它限制了客户可以建立的连接数。在这种模式下,maxconnection表示允许在服务器上待调度的最大连接数,maxpendingchannels指的是可靠会话的连接数。