Re: the 4th parameter of 'recv' function, 0?



Assume oef -> eof? I don't know what eof on a socket means. The peer can
close the socket and then you would get a return of 0 for recv. Also don't
know what is meant by "magic numbers as default." As stated, 0 for 4th
parameter is typical case, no magic. Sounds as if your particular problem
has more to due with perl than the win32 network API. I've never seen the
behavior you describe when using recv the same way in a C program.

LA

"freefox" <robert.locke@xxxxxxxxxxxxxxxx> wrote in message
news:4cfd1bfd-16b8-4c1e-b94c-5b29440e39ef@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 11 Aug, 21:08, "Alexander Nickolov" <agnicko...@xxxxxxxx> wrote:
That's the normal case and I imagine 99% of the socket code
out there uses no specialflags.

Still it is strange to require magic numbers as default.

I too have a hard time figuring out what it is suppose to offer.
In my (Perl) program recv hangs until it have read as many bytes as
specified by the third arg.
As I understand the documentation that is the behavior if MSG_WAITALL
is set.
But I have set the 'flag' 0, which means ???

I just wanna read until oef on the socket. How do I do that?

Best regards!


.



Relevant Pages

  • Re: Synchronization with CAsyncSocket in CE 6.0
    ... number of bytes in the first packet, followed by packets of, say 1024 bytes. ... recv() operations, reassembling it into the format that you need. ... don't forget that recv can return zero, if the socket has ... So, CAsyncSocket while possibly a bad way to do things, does not appear to ...
    (microsoft.public.windowsce.embedded)
  • Re: sockets: detecting closed sockets/dead clients or servers
    ... For detecting a such a socket when reading, ... if {[eof $socket]} ... If you're doing this in a fileevent handler, ...
    (comp.lang.tcl)
  • Re: Receive no data
    ... It is a best practice to shutdown ... a socket for sending once all data has been sent. ... I see multiple recv() statements in the code. ...
    (microsoft.public.win32.programmer.networks)
  • RE: BUG in Winsock on P4 HT CPU
    ... If you read the help on WSAAsyncSelect it states ... Network transport stack receives 100 bytes of data on socket s and causes ... The application issues recv(s, buffptr, 50, 0) to read 50 bytes. ... on CPU's that do not support HT, or CPUs with HT disabled. ...
    (microsoft.public.win32.programmer.networks)
  • Re: recv() hangs until SIGCHLD ?
    ... Both lsof and ls /proc//fd show that the socket used is in ESTABLISHED mode but when checking on the host on which it's connected we can't find the corresponding client socket. ... We are correctly handling EINTR in sendand recv() by restarting the call in case they get interrupted this way. ... However since this problem does not occur without threads, we can be sure that the blame is still on the receiver. ... In a practical case, we have a thread blocked in recvfor more than 12 hours, which is way beyond the timeout of the sender connection. ...
    (Linux-Kernel)

Loading