IOCP: how does the kernel decide to complete WSASend synchronously or asynchronously?

后端 未结 1 1536
[愿得一人]
[愿得一人] 2021-01-23 20:34

We wrote software that leverages I/O Completion Ports, and uses WSASend on SOCKET objects, WriteFile on named pipes.

In both situations we are finding that those APIs re

相关标签:
1条回答
  • 2021-01-23 21:21

    Why do you think you need to know or care. It's not a documented part of the API and it's possibly affected by the drivers and any layered service providers in the stack at the time.

    You have to write the correct code to handle either a successful 'synchronous' send or a pending 'asynchronous' send so what difference does it make how often you get either kind of result?

    Also, unless you are using SetFileCompletionNotificationModes() to enable FILE_SKIP_COMPLETION_PORT_ON_SUCCESS the same code path is used for both sync and pending results.

    0 讨论(0)
提交回复
热议问题