B
Babacio
Hi,
I try to use NetServer::Generic. Let's look to the example of the doc.
(I copy/paste it).
my $server_cb = sub {
my ($s) = shift ;
print STDOUT "Echo server: type bye to quit, exit ",
"to kill the server.\n\n" ;
while (defined ($tmp = <STDIN>)) {
return if ($tmp =~ /^bye/i);
$s->quit() if ($tmp =~ /^exit/i);
print STDOUT "You said:>$tmp\n";
}
}
my ($foo) = new NetServer::Generic;
$foo->port(9000);
$foo->callback($server_cb);
$foo->mode("forking");
print "Starting server\n";
$foo->run();
The problem is that when connecting to the server (let's say with
telnet or Net::Telnet), the welcome message is displayed only after
the client sent something. Any hint ?
I try to use NetServer::Generic. Let's look to the example of the doc.
(I copy/paste it).
my $server_cb = sub {
my ($s) = shift ;
print STDOUT "Echo server: type bye to quit, exit ",
"to kill the server.\n\n" ;
while (defined ($tmp = <STDIN>)) {
return if ($tmp =~ /^bye/i);
$s->quit() if ($tmp =~ /^exit/i);
print STDOUT "You said:>$tmp\n";
}
}
my ($foo) = new NetServer::Generic;
$foo->port(9000);
$foo->callback($server_cb);
$foo->mode("forking");
print "Starting server\n";
$foo->run();
The problem is that when connecting to the server (let's say with
telnet or Net::Telnet), the welcome message is displayed only after
the client sent something. Any hint ?