Why does my ActivePerl program on Windows stop accepting socket connections?

I use fork()Perl on Windows (ActivePerl) for the base socket server, but apparently there are problems (it will not accept connections after several times), is there a workaround?

Here is part of the relevant code:

while($client = $bind->accept()) {
    $client->autoflush();
    if(fork()){ $client->close(); }
    else { $bind->close(); new_client($client); exit(); }
}
+5
source share
3 answers

Net::Server , , , forking logic, Net:: Server , ActivePerl. Net::Server::Fork , , Net::Server::Prefork, .

+6

, 64, . waitpid -1,&WNOHANG .

+3

Windows . .

The best solution is probably to rewrite the code so it doesn't use fork. Maybe topics?

+1
source

All Articles