Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: close_on_exec in Perl : close socket opened in parent process when fork child , is not working

by chinaxing (Acolyte)
on Jan 18, 2013 at 02:56 UTC ( #1013941=note: print w/ replies, xml ) Need Help??


in reply to Re: close_on_exec in Perl : close socket opened in parent process when fork child , is not working
in thread close_on_exec in Perl : close socket opened in parent process when fork child , is not working

this should be the mojolicious's problem. normal socket program is ok .

foreaxmple, the following code, close_on_exec works.
#!/bin/env perl use Modern::Perl; use IO::Socket; # or Socket; $^F=2; # server my $server_port = 4444; my $server = IO::Socket::INET->new( LocalPort => $server_port, Type => SOCK_STREAM, Reuse => 1, Listen => 10) or die "Couldn't be a tcp server on port $server_port:$!\n"; my $client; while($client = $server->accept()){ say 'client connected ...'; system('/home/admin/t.sh &>/dev/null &'); }


Comment on Re^2: close_on_exec in Perl : close socket opened in parent process when fork child , is not working
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (17)
As of 2015-07-29 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls