关于CreateNamedPipe API中的nMaxInstances限制 [英] Regarding nMaxInstances limitation in CreateNamedPipe API

查看:79
本文介绍了关于CreateNamedPipe API中的nMaxInstances限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


   我有一个使用命名管道服务器为我的组织开发的调度程序应用程序。目前,我使用
CreateNamedPipe  API来创建多线程命名管道服务器。它将作为调度程序并并行地为许多命名管道客户端提供服务。


关于这一点,文档引用如下:



nMaxInstances  [in]

< p style ="margin-bottom:0px; padding-bottom:15px; line-height:1.429em!important">
可以为此管道创建的最大实例数。管道的第一个实例可以指定此值;必须为管道的其他实例指定相同的编号。可接受的值范围为1到  PIPE_UNLIMITED_INSTANCES  (255)。


根据这一点,我们对管道服务器可以并行连接的管道客户端数量有限制。它限制为255.


从这个意义上说,我的管道服务器最多只能服务255个并行管道客户端?


是有没有办法超越这个限制?


目前,我要求并行服务400个客户端。


任何帮助都将受到高度赞赏。


谢谢,


Kalai D。


解决方案

感谢您的回复。如果我理解你是正确的,我可以设置    PIPE_UNLIMITED_INSTANCES 
我的服务器管道。


虽然名称  PIPE_UNLIMITED_INSTANCES
看起来是无限制访问,它是一个定义为255的等效宏值,不是吗?请确认一下?


您的意思是说,我可以继续将400个客户端管道并行连接到我的管道服务器吗?


Hi,

   I have a scheduler application developed for my organization using named pipe server. Currently I used CreateNamedPipe  API to create a multi-threaded named pipe server. It will act as a scheduler and service many named pipe clients in parallel.

Regarding that, the documentation quotes as below:

nMaxInstances [in]

The maximum number of instances that can be created for this pipe. The first instance of the pipe can specify this value; the same number must be specified for other instances of the pipe. Acceptable values are in the range 1 through PIPE_UNLIMITED_INSTANCES (255).

As per that, we have limitation on number of pipe clients that a pipe server can connect in parallel. It is limited to 255.

In that sense, my pipe server can only service 255 parallel pipe client at max?

Is there any way to override this limitation?

Currently, I have requirement to service 400 clients in parallel.

Any help would be highly appreciated.

Thanks,

Kalai D.

解决方案

Thanks for the reply. If I understand you correct, I can set  PIPE_UNLIMITED_INSTANCES for my server pipe.

Though the name PIPE_UNLIMITED_INSTANCES looks to be an unlimited access, it is an equivalent macro value defined as 255, is it not? Please confirm this?

You mean to say, I can go ahead and connect 400 client pipes in parallel to my pipe server?


这篇关于关于CreateNamedPipe API中的nMaxInstances限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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