Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: Socket deadlock doubt in code

by rowdog (Curate)
on Jun 23, 2010 at 23:30 UTC ( #846197=note: print w/replies, xml ) Need Help??


in reply to Re^3: Socket deadlock doubt in code
in thread Socket deadlock doubt in code

gethostbyname relies on a functioning DNS system. Make sure things like nslookup and traceroute work properly. The other place you might be going wrong is that in a scalar context, gethostbyname returns the packed ip address, though I'm not sure why you're looking up the hostname from a hostname to begin with.

As for the printing issue, I suspect that you are Suffering from Buffering.

Update: oops, gethostbyname is irrelevant here but the DNS still needs to work.

Replies are listed 'Best First'.
Re^5: Socket deadlock doubt in code
by sajanagr (Acolyte) on Jun 24, 2010 at 05:27 UTC
    Hi

    I am using gethostbyaddr here at server's code to get the client's hostname. You can check the code in the first thread for the procedure.

    I am doing this to find out which client has connected to the server.

    I am tracking the issue for the DNS right now, since the current setup is between two VM machines.

      Sorry, my mistake. I would think the problem is your DNS set up since your gethostbyaddr code works fine here.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://846197]
help
Chatterbox?
[LanX]:  last hour of cb doesn't break
[LanX]: 12345678901234- 123456789012345678 901234567890123456 789012345678901234 567890123456789012 345678901234567890 123456789012345678 901234567890123456 789012345678901234 567890123456789012 345678901234567890 123456789012345678 901234567890123456 789012345678901234 567890

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2017-07-24 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (351 votes). Check out past polls.