Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How do I do a non-blocking accept?

by posicat (Initiate)
on Oct 11, 2004 at 19:54 UTC ( #398267=note: print w/replies, xml ) Need Help??


in reply to How do I do a non-blocking accept?

I spent a few hours and finally found this paramater you can pass to the IO::Socket::INET ... Timeout =>
my $sock = new IO::Socket::INET ( LocalPort => '1401', Proto => 'tcp', Listen => 1, Reuse => 1, Timeout => .1, );
After .1 seconds it times out the accept command and continues on through your loop happily. As an added benefit this helps you prevent race conditions.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://398267]
help
Chatterbox?
[Discipulus]: which node yesterday?
[Discipulus]: i cannot see any link to tye post..
[Lady_Aleena]: Hello.
[marto]: teleconf + coffee, I'll post it in a few mins
[beech]: fencepost?
beech is protected with velcro
[Lady_Aleena]: How is velco protective? It sticks to a lot of things.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-06-23 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (538 votes). Check out past polls.