PGM发送窗体大小

使用PGM发送数据的时候, 程序报告了一下如下的错误。
An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 224.0.0.26:11600

   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at PgmSocketNet.PgmSender.Connect() in E:\Code\功能代码-服务器端\PGM_Test\PgmSocket\PgmSender.cs:line 24
   at PGMSender.Program.testPGMSender(Object state) in E:\Code\功能代码-服务器端\PGM_Test\PGMSender\PGMSender\Program.cs:line 42
A:

问题找到了,我使用的组件默认每个PGMsocket 配置的发送缓存是接近10M,这样128个连接大致的1G的内存消耗, 而socket的缓存可能也就是1G大小(Socket的最大缓存多大需要证实,现在还不清楚),这样也就能支持100来个连接.解决方法:将每个连接的缓存缩小到64k一下,理论上的连接数最大值提高了200被,能到20000个,普通程序是个够用了。

原文地址:https://www.cnblogs.com/dunnice/p/1593202.html