I don't think signals are suported on Win32 boxes.
Cheers,
John

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of David Liouville
> Sent: Thursday, March 31, 2005 12:00 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: Socket + fork
> 
> 
> Could anybody tell me wy my server is closed at the #65 query 
> from client ? (I fork the server socket for futur use of many 
> clients) The parent process of the server seems to be closed 
> at the #65 execution of the ping query, but I don't 
> understand wy ... Thanks for help.
> 
> ########### Server ###########
> 
> use IO::Socket;
> 
> $server = IO::Socket::INET->new(
>       Proto     => 'tcp',
>       LocalPort => "9000",
>       Listen    => 10,
>       Reuse     => 1
> ) or die "can't setup server";
> 
> while ($client = $server->accept())
> {
>       $SIG{CHLD} = 'IGNORE';
>       my $child = fork;
>       do { close $client; next; } if $child;
>       $client->autoflush(1);
> 
>       while (<$client>)
>       {
>               $IntMatchCmd = 0;
>               chomp();
> 
>               if (m/ping/)
>               {
>                       $IntMatchCmd = 1;
>                       $client->send("pong\n",'');
>               }
>               else
>               {
>                       print "unknown cmd";
>               }
> 
>               close $client;
>               print "close pid : '$child'\n";
>               exit;
>       }
> }
> ########################################################
> 
> ############## Client ##################
> use IO::Socket;
> 
> $IntCpt = 1;
> 
> while (1)
> {
>       print "#$IntCpt\n";
>       if ($TO_SERVER = IO::Socket::INET->new(
>               Proto => "tcp",
>               PeerAddr => "127.0.0.1",
>               PeerPort => "9000",
>               Type      => SOCK_STREAM,
>               Reuse     => 1
>       ))
>       {
>               $IntCpt++;
>               $TO_SERVER->send("ping\n",'');
> 
>               while (<$TO_SERVER>)
>               {
>                       chomp();
>                       $StrResponse = $_;
>                       print "Response : '$StrResponse'\n";
>               }
>       }
>       else
>       {
>               print "Error\n";
>       }
> } 
> ########################################################
> 
> 
>       Olix    David Liouville
> ADR  : 1bis rue St Louis 35000 Rennes
> GSM : 06 88 70 16 45
> TEL   : 02 99 79 04 78
> FAX  : 02 99 79 78 17
> WEB : http://www.olix.fr 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 27/03/2005
>  
> 
> 
> _______________________________________________
> Perl-Win32-Users mailing list 
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to