c++ - WSARecv() and multiple buffers -
i precision wsarecv.
basically seems can use function array of wsabufs.
1- in overlapped i/o context without completion ports, use wsarecv() on datagram socket array of 48 wsabufs, means can receive 48 different udp packets (1 packet each buffer) in single call (say arrive @ same exact moment)? or way receive 48 packets use wsarecv() 48 times after event has been signaled (using overlapped i/o events not completion ports, repeat).
2- in context with i/o completion ports/overlapped i/o, means can replace this
int n = 48; (int = 0; < 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);
basically mean's calling wsarecv() 48 buffers post 48 read requests?
3- if not, purpose of array of wsabuf's? mean, 1 of correct size suffice no?
thanks lot!
one wsarecv()
== 1 datagram. multiple buffers allow split datagram header, body, trailer, etc., if know how big things in advance. doesn't let receive 48 datagrams @ once.
Comments
Post a Comment