Re: Did WSASend always returned SOCKET_ERROR and error code is WSA_IO_PENDING .. ??

Tech-Archive recommends: Fix windows errors by optimizing your registry



That usual but not always behavior.
From MSDN :

Overlapped Socket I/O

If an overlapped operation completes immediately, WSASend returns a value of
zero and the lpNumberOfBytesSent parameter is updated with the number of
bytes sent. If the overlapped operation is successfully initiated and will
complete later, WSASend returns SOCKET_ERROR and indicates error code
WSA_IO_PENDING.

HTH
Arkady

"madmanahong" <madmanahong@xxxxxxx> wrote in message
news:1157517005.292964.292540@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Did WSASend always returned SOCKET_ERROR and error code is
WSA_IO_PENDING when I set overlapped..

I used IOCP, through observed, I Find WSASend always return
SOCKET_ERROR, and error code is WSA_IO_PENDING. Is right of my
observed?

Does WSASend can return zero when I set overlapped( example: IOCP )?



.



Relevant Pages

  • Re: Did WSASend always returned SOCKET_ERROR and error code is WSA_IO_PENDING .. ??
    ... Even for non-overlapped operations successful return value of send bytes ... Overlapped Socket I/O ... If an overlapped operation completes immediately, WSASend returns a value ... I set the SO_SNDBUF zero. ...
    (microsoft.public.win32.programmer.networks)
  • Re: Did WSASend always returned SOCKET_ERROR and error code is WSA_IO_PENDING .. ??
    ... Overlapped Socket I/O ... If the overlapped operation is successfully initiated and will ... WSASend returns SOCKET_ERROR and indicates error code ... I set the SO_SNDBUF zero. ...
    (microsoft.public.win32.programmer.networks)
  • Did WSASend always returned SOCKET_ERROR and error code is WSA_IO_PENDING .. ??
    ... I used IOCP, through observed, I Find WSASend always return ... and error code is WSA_IO_PENDING. ... Does WSASend can return zero when I set overlapped(example: IOCP)? ...
    (microsoft.public.win32.programmer.networks)
  • Re: IOCP and WSASend
    ... > I'm using IOCP and WSASend to send data. ... > invoke WSASend i recieve result 0, i mean that data is sent and close ... you will be getting a completion notice as soon as it completes". ... Almost all of the time a return value of zero should get treated the same as ...
    (microsoft.public.win32.programmer.networks)
  • Re: IOCP threads and WSASend synchronization questions
    ... I'm writing a socket server using IOCP and can't figure out how to ... The IOCP event is picked up by one of the worker threads in the thread ... pending the data and socket is queued, otherwise the thread calls WSASend ...
    (microsoft.public.win32.programmer.networks)