Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Sockets

by jepri (Parson)
on Jan 08, 2002 at 15:49 UTC ( #137103=note: print w/ replies, xml ) Need Help??


in reply to Sockets: Client keeps waiting

You need to 'accept' the socket. The old socket is then reused:

print "Incoming connection detected!\n"; my $new_sock = $listen_sock->accept or die "Could not accept socket: $!";

then you should do a

recv $new_sock,$z,10000,0;

to read from your socket. tye will tell you that <SOCKET> is bad, mmmmkay?

Sorry.. too tipsy to do more than cut and paste from my own code.

As near as I can tell 'accept' clones the socket, then goes back to listening on the old one. If anyone here would care to explain...

The docs are pretty short on this operation. Going through other people's code is the best way in this case.

____________________
Jeremy
I didn't believe in evil until I dated it.


Comment on Sockets
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-09-16 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (47 votes), past polls