in reply to Re: Telnet server that read a single character
in thread Telnet server that read a single character

I tried to use HalfDuplex module, but I have the same problem.
sub 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; }
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 Shay

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
    Someone? I simply want a tcp server that read a single character from the client. I don't care how.
      Maybe it is already solved... but seems to be useful to someone else. Don't use Term::ReadKey. You should negotiate remote telnet client from server side during session. Read this: http://stackoverflow.com/questions/273261/force-telnet-client-into-character-mode http://hints.jeb.be/protocols/telnet-network-virtual-terminal-nvt/ http://stackoverflow.com/questions/4532344/send-data-over-telnet-without-pressing-enter