Hey all,
I'm getting into overlapped i/o and using WSASendTo to send off my data. After reading some stuff on MSDN I get the impression that WSASendTo is a wrapper for WriteFileEx. Does anyone know if this is true? If it is, I'll switch to using WriteFileEx instead because it should theoretically be faster, and also I won't need winsock 2 this way. I could slide by on winsock 1.1 (just in case I have to support some old version of win95)
Thanks
--Chorus
BTW
Do I have to call WSAWaitForMultipleEvents before and after I call WSASendTo?? It seems I need to call it before so that I know the WSASendTo will work, and I need to call it after to set the thread to alertable wait state to call my completion routine.
I'm getting into overlapped i/o and using WSASendTo to send off my data. After reading some stuff on MSDN I get the impression that WSASendTo is a wrapper for WriteFileEx. Does anyone know if this is true? If it is, I'll switch to using WriteFileEx instead because it should theoretically be faster, and also I won't need winsock 2 this way. I could slide by on winsock 1.1 (just in case I have to support some old version of win95)
Thanks
--Chorus
BTW
Do I have to call WSAWaitForMultipleEvents before and after I call WSASendTo?? It seems I need to call it before so that I know the WSASendTo will work, and I need to call it after to set the thread to alertable wait state to call my completion routine.
Of course... it would help if I could get WriteFileEx to work...
Ok... new question...
I can get WriteFileEx to send data out on a socket but I since I can't specify a port or desination IP with WriteFileEx, I'm not sure how to direct it anywhere. I tried using a raw socket and building the IP and UDP header myself, I also tried binding the port before the send, but neither seemed to work
Any ideas would be greatly appreciated
--Chorus
I can get WriteFileEx to send data out on a socket but I since I can't specify a port or desination IP with WriteFileEx, I'm not sure how to direct it anywhere. I tried using a raw socket and building the IP and UDP header myself, I also tried binding the port before the send, but neither seemed to work
Any ideas would be greatly appreciated
--Chorus
Close :)
WSASendTo and WriteFileEx are both functions which utilize IO Control (IOCTL) functions. Specifically, _lwrite.
They both thunk down to the same function, because socket handles and file handles are both considered to be "IO handles" by WinOs, which really is a ripoff of Unix as we all know, where everything is a "file handle" :alright:
WSASendTo and WriteFileEx are both functions which utilize IO Control (IOCTL) functions. Specifically, _lwrite.
They both thunk down to the same function, because socket handles and file handles are both considered to be "IO handles" by WinOs, which really is a ripoff of Unix as we all know, where everything is a "file handle" :alright: