3SRT has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # includes and dependencies.... use strict; use warnings; my $max_clients = 10; my $port = 15100; while(1) { my $sock = new IO::Socket::INET ( LocalHost => 'localhost', LocalPort => $port, Proto => 'tcp', Listen => $max_clients, Reuse => 1, ); die "Could not create socket: $!\n" unless $sock; my $new_sock = $sock->accept(); while(<$new_sock>) { # parse information close($sock); #send e-mail function here unless(fork) { # sleep for given time sleep(30); # perform function #2nd send e-mail function here exit(0); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Fork issues
by almut (Canon) on Feb 12, 2008 at 22:21 UTC | |
|
Re: Fork issues
by superfrink (Curate) on Feb 13, 2008 at 06:10 UTC | |
|
Re: Fork issues
by pc88mxer (Vicar) on Feb 13, 2008 at 04:39 UTC | |
|
Re: Fork issues
by starbolin (Hermit) on Feb 13, 2008 at 00:56 UTC | |
by starbolin (Hermit) on Feb 13, 2008 at 01:58 UTC | |
|
Re: Fork issues
by wazoox (Prior) on Feb 13, 2008 at 14:27 UTC | |
by alexm (Chaplain) on Feb 13, 2008 at 16:40 UTC |