Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: perldoc recv, Net::Time and HP-UX

by KPeter0314 (Deacon)
on Jun 19, 2003 at 19:19 UTC ( [id://267317]=note: print w/replies, xml ) Need Help??


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

Confirming what you are seeing, I tried this on a couple of our systems. Solaris, RedHat Linux, and HPUX. Some with 5.6 and some 5.8.

I must be seeing something different than you. I couldn't get the 'tcp' inet_time to work, but 'udp' works like a charm across the board. I checked and the tcp time service just to be sure I wasn't going crazy and it was running on all these servers.

I was just using your one-liner. Is there something else that needs to be done to get the tcp results?

Slightly modified to see if there really was ouput:

# perl -MNet::Time=inet_time -le 'print "1: ", inet_time("localhost", +"udp", 10 ), ":\n";' 1: 1056049512: # perl -MNet::Time=inet_time -le 'print "1: ", inet_time("localhost", +"tcp", 10 ), ":\n";' 1: :
This works the same for any of the above type hosts instead of "localhost".

As far as reporting this goes, have you tried the author Graham Barr?

-Kurt

Replies are listed 'Best First'.
Re: Re: perldoc recv, Net::Time and HP-UX
by castaway (Parson) on Jun 20, 2003 at 06:59 UTC
    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.

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://267317]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found