Say I post the following WSASend call (Windows I/O completion ports without callback functions):
void send_data()
{
WSABUF wsaBuff[2];
wsaBuff[0].len = 20;
wsaBuff[1].len = 25;
WSASend(sock, &wsaBuff[0], 2, ......);
}
When I get the “write_done” notification from the completion port, is it possible that wsaBuff[1] will be sent completely (25 bytes) yet wsaBuff[0] will be only partially sent (say 7 bytes)?
As
WSASendis the preferred way of doing overlapped socket IO, it would not make any sense if it completed while incomplete – the completion notification/routine/event is the only way for the application to cleanup/recycle the used structures.Also: NO, it’s not possible, a single
WSASendcall is still a single IO call, regardless of the buffers used.