加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows – Win32命名管道和邮件大小限制 – 旧的64K限制仍然适

发布时间:2020-12-13 21:26:19 所属栏目:Windows 来源:网络整理
导读:Win32曾经有消息模式管道的消息大小限制为64K,如KB文章 Q119218 PRB: Named Pipe Write() Limited to 64K的残余部分所见.“适用于”部分仅列出“Microsoft Win32应用程序编程接口”,文章相当陈旧;没有迹象表明它是否也适用于Windows 7等合理的当前版本.是否
Win32曾经有消息模式管道的消息大小限制为64K,如KB文章 Q119218 PRB: Named Pipe Write() Limited to 64K的残余部分所见.“适用于”部分仅列出“Microsoft Win32应用程序编程接口”,文章相当陈旧;没有迹象表明它是否也适用于Windows 7等合理的当前版本.是否有关于该问题的可靠,最新信息?

当前的在线文档仅包含未指定限制的模糊提示,例如CreateNamedPipe()功能文档中的这个美丽措辞:

The input and output buffer sizes are advisory. The actual buffer size reserved for each end of the named pipe is either the system default,the system minimum or maximum,or the specified size rounded up to the next allocation boundary.

没有迹象表明“系统最大值”可能是什么,或者如何查询其值.

TransactNamedPipe()的文档中再次出现64K限制:

The maximum guaranteed size of a named pipe transaction is 64 kilobytes. In some limited cases,transactions beyond 64 kilobytes are possible,depending on OS versions participating in the transaction and dynamic network conditions. However,there is no guarantee that transactions above 64 kilobytes will succeed.

但是,极限可能只适用于TransactNamedPipe()意义上的命名管道“事务”;也就是说,写入后跟读取,全部包含在单个系统调用和/或网络事务中.该限制可能与SMB有关,因此不适用于本地管道.这有什么硬信息吗?

消息模式管道非常适合当前项目,其中服务器进程获取请求数据包并提供单个响应数据包,调度程序是Apache中托管的简单多线程存根(类似于mod_fcgid).字节模式管道需要一些额外的框架,这使得消息模式管道看起来更简单,因此更可取.但是,不能将请求和响应大小限制为64K;因此这个问题.

不,不再有任何此类限制.

documentation for WriteFile说:

Windows Server 2003 and Windows XP: Pipe write operations across a network are limited in size per write. The amount varies per platform. For x86 platforms it’s 63.97 MB. For x64 platforms it’s 31.97 MB. For Itanium it’s 63.95 MB.

由此我们可以得出结论,该限制不适用于当前版本的Windows,并且可能仅在处理网络管道时应用于XP.

我们还可以观察到,如果Q119218适用于当前版本的Windows,则它不会被归档.

实验上,我可以确认在Windows 7 SP1 x64上,本地消息模式管道可以处理大小超过1 GB的消息. (我开始在1650MB左右的某个地方获得“系统资源不足”消息.)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读