Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Detecting a closed socket

by Flame (Deacon)
on Aug 06, 2003 at 01:30 UTC ( #281238=note: print w/ replies, xml ) Need Help??


in reply to Detecting a closed socket

Ok, I think I've got my solution then:

unless(sysread($handle,$count,4) == 4 && $count =~ m/^\d{4}$/ && + sysread($handle,$message,$count) == $count){ # print "Error/Disconnect\n"; return; }

I've tested it and it seems to work. Thanks to everyone for the input.



My code doesn't have bugs, it just develops random features.

Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)

Comment on Re: Detecting a closed socket
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2016-04-29 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (438 votes). Check out past polls.