Closed snej closed 4 years ago
This is pretty close to what I have. I'll merge and include my readv()
I pushed this into an io_vec
branch, for now. I will have a closer look, implement readv(), and write the unit tests and docs.
Oh, and thanks again!
Actually, I'm a little confused about the Windows implementation, looking at the documentation for WSASendMsg
here:
https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasendmsg
The WSASendMsg function can only be used with datagrams and raw sockets. The socket descriptor in the s parameter must be opened with the socket type set to SOCK_DGRAM or SOCK_RAW.
So, will it work with stream sockets?
In addition, when I try to compile in the read variant, WSARecvMsg()
I get a build error, saying that it's not found.
error C3861: 'WSARecvMsg': identifier not found
Any ideas?
Hm I've been away from this for a bit but I didn't notice that part of the documentation. Are there tests that cover this part? I might have seen it and assumed it worked because of its similarity to the Unix variant.
It looks like WSASend, not WSASendMsg
is the one we are after. The signature is almost identical, except that it takes its arguments in two parameters instead of one combined one for the buffers. Perhaps WSARecv
is also the one to use for the reverse (which is where, actually?)
I moved this pull request into the io_vec
branch, so I could start messing around with it. I didn't push the last stuff I did in Windows as it was turning into an ugly hack fest. I'll do a quick cleanup, maybe look at WSASend/Recv, and git it a push.
@borrrden I just put in WSASend/Recv. It compiles, but I don't have time to test it today. I'll get back to it in a day or two.
Scatter/gather write method, like
writev
. Credit to @borrrden for the Windows version.26