i tried this with
my $port = 6000;
my $host = 'localhost';
my $proto= getprotobyname('tcp');
my $iaddr = inet_aton($host);
my $paddr = sockaddr_in($port, $iaddr);
my $code = 'INSERT INTO test (r1, r2, r3) VALUES (1,2,3);\n';
socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
connect(SOCK, $paddr) || die "connect: $!";
print SOCK $code;
close (SOCK) || die "close: $!";
but after one connection attempt succeeded, the second one kills the deamon.pl:
linux:/srv/www/system # ./deamon.pl &
1 7336
linux:/srv/www/system # ./client.pl
linux:/srv/www/system # ./client.pl
1+ Stopped ./deamon.pl
linux:/srv/www/system #
...strange... :-( ...i use a logfile for the data the deamon.pl receives, and the first connections data was logged; but not the second ones....