Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 wandering the Monastery: (6)
As of 2016-10-01 21:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (8 votes). Check out past polls.