可以连接到命名管道的客户端数量

发布于 2024-07-30 09:25:34 字数 228 浏览 1 评论 0原文

假设服务器创建了一个命名管道“myTestPipe”。 有多少客户端可以连接到“myTestPipe”? 从我在网上读到的信息来看,似乎只有一个客户可以,但想确定一下。

如果只有一个,那么最好使用阻塞的 WaitForConnection() 而不是 Asunchronous 方法 BeginWaitForConnection(),因为服务器将等待客户端进程连接,然后进行通信?! (无需担心其他客户端连接)

Say a server created a named pipe "myTestPipe". How many clients can connect to "myTestPipe"? From what I have read on the Web, it seems only one client can, but wanted to make sure.

If only one, then it's best to use the blocking WaitForConnection() instead of the Asunchronous method BeginWaitForConnection() as the server will wait until a client process connects and then do the communication?! (no need to worry about other clients to connect)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

新雨望断虹 2024-08-06 09:25:34

您可以让多个客户端连接到同一命名管道。 在 Windows 上,我认为当前的限制是到单个命名管道的 256 个同时连接,包括服务器的连接。

(不幸的是,我无法找到适当的 MSDN 页面以供参考,但是这个 CPAN 管道参考提到了此限制。)

You can have more than one client connect to the same named pipe. On Windows, I believe the current limitation is 256 simultaneous connections to a single named pipe, including the server's connection.

(Unfortunately, I can't track down the appropriate MSDN page for reference, but this CPAN pipes reference mentions this limitation.)

苦行僧 2024-08-06 09:25:34

实际上,您创建一个管道并等待连接,当它连接时,创建第二个管道并等待它。

对于您创建并等待连接的每个管道,您最多获得一个连接(一次 - 如果它们是请求/响应/关闭样式,您可以回收它们)。

因此,每个连接都是一对一的,就像套接字或其他流一样。

You actually create one pipe and wait for a connection, and when it connects, create a second one and wait on it.

For each pipe you create and wait for connection on, you get at most one connection (at a time - you can recycle them if they are request/response/close style).

Thus, each connection is 1-to-1, like a socket or other stream.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文