Shane,
while (my ($client, $client_address) = $server->accept()) {
my ($port, $packed_ip) = sockaddr_in($client_address);
my $client_ip = inet_ntoa($packed_ip);
my $stamp = ×tamp;
print LOGFILE "$stamp - Client ($client_ip) connected.\n" if $DEBUG ==
1;
$client->recv($recv, 128);
chomp($recv);
if (exists($commands{$recv})) {
$client->send("Works! Received: $recv");
} else {
$client->send("Doesn't work! We received this: $recv");
}
}
It could be IO buffering (this, btw, is a wild guess); try putting:
$| = 1;
As close to the beginning of the file/script as you can and see what
happens.
DSL
1) http://perl.plover.com/FAQs/Buffering.html
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html