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
mean that those bytes move to kernel socket and not yet really send. You
never know if data really send. The only correct way is to receive reply
from peer host about that
Arkady

"madmanahong" <madmanahong@xxxxxxx> wrote in message
news:1157627244.668853.131290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Arkady Frenkel ??:

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.



forget to say, I set the SO_SNDBUF zero.
so that, always return WSA_IO_PENDING.

I guess, although WSASend returns zero, the operation doesn't completes
immediately. instead WSASend copy the buffer in SOCKET buffer.

so if you se SO_SNDBUF zero, WSASend should always returns
WSA_IO_PENDING..

hehe ~:)


.



Relevant Pages

  • Re: sockets -- basic udp client
    ... print "Received from server: %s" % buf ... default for timeout is no timeout, or block forever, your question: ... a time out on the socket, and you receive no data and the timeout ... of detecting a zero length datagram as transmitted ...
    (comp.lang.python)
  • Re: IOCP question: ordering of data
    ... WSASend will never return with a partial ... Microsoft MVP, MCSD ... If multiple iocp-worker threads are used, ... My understanding is that if I issue only ONE WSASend on one socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: IOCP question: ordering of data
    ... A good example of such is iocp sample in PSDK which use additional ... WSASend will never return with a partial ... If multiple iocp-worker threads are used, ... My understanding is that if I issue only ONE WSASend on one socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Socket read() call returns zero on a transient error
    ... In case my read call returns zero, ... close the socket connection with the server. ... Is there some better way to know that the socket connection at the ... > test for the EINTR or EAGAIN codes. ...
    (comp.unix.programmer)
  • Re: Socket read() call returns zero on a transient error
    ... In case my read call returns zero, ... close the socket connection with the server. ... Is there some better way to know that the socket connection at the ... > test for the EINTR or EAGAIN codes. ...
    (comp.unix.programmer)