I am trying to understand how IOCP works with sockets. I need to understand if this is how they work:
I create a completion port, which is nothing but a queue that will receive notifications when some operation completes, and then I associate my socket with it, and then I process incoming notifications.
Now I want to know how this relates to receiving of data from a socket, so when I call WSARecv()
what exactly happens, does WSARecv()
returns immediately when I call it (does not block) and then later on when data arrives to WSARecv()
I get a notification that data were received?