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 davidnicol (Acolyte)
on Aug 23, 2004 at 01:46 UTC ( #384997=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      foreach (@Listeners){
       vec($rout,fileno($_),1) or next;
    ...
       while (accept(my $NewServer, $_)){
          push @Clients, $NewServer
          
    
  2. or download this
      foreach (@Listeners){
       vec($rout,fileno($_),1) or next;
    ...
          push @Clients, $NewServer
       }else{ log "accept: $!" }
          
    
  3. or download this
      foreach (@Listeners){
       vec($rout,fileno($_),1) or next;
    ...
       select($rvec,undef,undef,0);
       vec($rvec,fileno($_),1) and goto acc;
          
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://384997]
help
Chatterbox?
[thezip]: I suppose could check if readdir() returns other than '.' and '..', but that seems ugly.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2017-03-28 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (339 votes). Check out past polls.