大网数据广告活动
网络与域名解析

Client-side Asynchronous Pipe Handling

· 52CE 我爱测

Before making an asynchronous remote call, the client must first initialize the asynchronous handle.

Before making an asynchronous remote call, the client must first initialize the asynchronous handle. As with nonpipe procedures, the client calls an asynchronous function with the asynchronous handle as the first parameter and uses the asynchronous handle to send and receive pipe data, query the status of the call, and receive the reply.

The client makes the asynchronous remote procedure call with the asynchronous handle as the first parameter. The client can use this handle to query the status of the call and to receive the reply. The asynchronous pipe model is symmetric. Both client and server applications send and receive pipe data actively (as opposed to synchronous RPC, where the pipe data is sent and received passively).

The client sends asynchronous pipe data by calling the push function on the appropriate asynchronous pipe, with the pipe's state variable as the first parameter. When the push function returns, the client can modify or free the send buffer.

If the RPC_ASYNC_NOTIFY_ON_SEND_COMPLETE flag is set in the asynchronous handle, and if APCs are used as the notification mechanism, an APC is queued when the pipe send is actually complete. You can take advantage of this mechanism to implement flow control. Note, however, that if the client pushes another buffer before the previous push is complete, the client may, depending on the speed of the transfer operation, receive only one send-complete notification, rather than one notification for each buffer or each push operation. When the client has sent all of the pipe data, it makes one final push call with the number of elements set to 0.

The client program receives asynchronous pipe data by calling the pull function on the appropriate asynchronous pipe, with the pipe's state variable as the first parameter. If no pipe data is available, the pull function returns RPC_S_ASYNC_CALL_PENDING.

If the notification mechanism is APC, and the server returned RPC_S_ASYNC_CALL_PENDING, the client must wait until it receives the RpcReceiveComplete APC from run-time before calling pull again.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。