gpt4 book ai didi

windows - 在命名管道上选择

转载 作者:可可西里 更新时间:2023-11-01 14:07:40 29 4
gpt4 key购买 nike

有没有办法在 win32 中的命名管道上执行 select()?我想让它阻止 ReadFile 调用,但只持续几秒钟,然后如果没有收到数据,则执行其他一些工作。

最佳答案

您不能在 win32 中的命名管道上使用 select()。为了模拟命名管道的类似选择功能,您可以通过重叠 I/O 模型和 WaitForMultipleObjects() 使用命名管道 API。

Click here for an example in MSDN for the same

关于windows - 在命名管道上选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3021424/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com