in reply to Re: perldoc recv, Net::Time and HP-UX
in thread perldoc recv, Net::Time and HP-UX

I didnt test udp much, as its not running everywhere here, but now I see you are right.. Seems I should have read HP-UXs docs more closely:

recvfrom() operates in the same manner as recv() except that it is abl +e to return the address of the socket from which the message was sent +. For connected datagram sockets, recvfrom() simply returns the same + address as getpeername() (see getpeername(2)). For stream sockets, +recvfrom() retrieves data in the same manner as recv(), but does not +return the socket address of the sender.
So it returns the address for udp, but not for tcp.
You did try it *on* the OSes mentioned, and not *to* them, right? (It should work fine from Linux, at least, it does here.)

Anyfish, I see someone already reported on libnet that the recv line should be changed to check for 'defined', about 8 months ago, and it hasn't been changed yet.. (OTOH the explanation why possibly wasn't very clear) So I'll probably write to him and ask. (Seeing as there was a new libnet recently, just not fixing that bug..)

After looking at various docs I'm now all confused as to whats incorrect. perldoc recv says:

Returns the address of the sender if SOCKET's protocol supports this; +returns an empty string otherwise.
What does it mean with "SOCKET's protocol"? I assumed that meant tcp or udp etc. In which case different behavior on hp and on linux is a bug. If it just means 'supported at all', then it's just a misleading doc.. Further, the recv/recvfrom manpage on Linux says they all return the length of the data received, bah, I'm confused ,)

C.

Replies are listed 'Best First'.
Re: Re: Re: perldoc recv, Net::Time and HP-UX
by KPeter0314 (Deacon) on Jun 20, 2003 at 15:23 UTC
    My testing was matrixed *from* each of the four selected systems *to* each of the other systems and another try on a loopback to itself for a total of 16 tests.

    I'm probably missing something for the tcp side. It should work, but I haven't put a lot of time into it.

    You can /msg me if you want more details. Looking at your node we are a few hours off so replies will probably be slow.

    -Kurt