Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 romping around the Monastery: (9)
As of 2014-09-18 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (125 votes), past polls