What is the maximum size that maxReceivedMessageSize can be set to for a NetNamedPipeBinding?

房东的猫 提交于 2019-12-18 10:39:30

问题


I noticed that 2147483647 seems to be a popular choice for maxReceivedMessageSize but is this the limit?


回答1:


Nope, the limit is Int64.MaxValue1 which is: 9223372036854775807




回答2:


MaxMessageReceivedSize in basicHttpBinding appears to be an int32 - setting it over the max value of an int32 results in:

This factory buffers messages, so the message sizes must be in the range of an integer value. Parameter name: bindingElement.MaxReceivedMessageSize




回答3:


MaxReceivedMessageSize and MaxBufferSize must same value and MaxBufferSize is Int32.




回答4:


Use the defaults for the maximum size so one doesn't fat finger a value:

binding.MaxBufferSize          = int.MaxValue;
binding.MaxReceivedMessageSize = long.MaxValue;


来源:https://stackoverflow.com/questions/1004717/what-is-the-maximum-size-that-maxreceivedmessagesize-can-be-set-to-for-a-netname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!