in reply to Re: Telnet server that read a single character
in thread Telnet server that read a single character
The same problem occur when I don't use localhost. What I'm tring to accomplish is a terminal that will be somewhat like cisco terminal, meaning it will auto complete options when I press <tab> or <?> Thanks, Dayan Shaysub Terminal { my ($server, $client) = @_; my $input; my $key; while (1) { #ReadMode(4, $client); while (not defined ($key = ReadKey(0, $client))) {}; #ReadMode(0, $client); if ($key eq "q") { return 1; } else { print "Got character '" . ord($key) . "'\r\n"; } }; return 0; } my $server = IO::Socket::Telnet::HalfDuplex->new ( Proto => 'tcp', LocalPort => 23, Listen => SOMAXCONN, Reuse => 1 ); print "Starting server\n"; while (my $client = $server->accept()) { Terminal($server, $client); close $client; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Telnet server that read a single character
by shupup (Initiate) on Apr 13, 2010 at 06:49 UTC | |
by Anonymous Monk on May 18, 2011 at 15:58 UTC |