Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 imbibing at the Monastery: (11)
As of 2016-06-25 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (326 votes). Check out past polls.