WSARecv () and several buffers

I need accuracy with WSARecv.

Basically, you can use this function with the WSABUF array.

1- In an overlapped I / O context WITHOUT completion ports, let's say I use WSARecv () on a datagram socket with an array of 48 WSABUFs, does this mean that I can receive 48 different UDP packets (1 packet for each buffer) into one call (let's say they come at the same moment)? Or the only way to get 48 packets is to use WSARecv () 48 times after the event has been signaled (using overlapped I / O with events, but not with completion ports, I repeat).

2- In the context With I / O I / O ports, this means that I can replace this

int n = 48;
for (int i = 0; i < n; i++)
   WSARecv(sock, &buffer_array[i], 1, NULL, 0, &overlapped, completion_routine);

With this?

WSARecv(sock, buffer_array, 48, NULL, 0, &overlapped, completion_routine);

, WSARecv() 48 48 ?

3- , WSABUF? , ?

!

+4
1

WSARecv() == . , , .., , . 48 .

+5

All Articles