trouble with perl and telnet

Discussion on the (deprecated) VideoLAN Server application as well as the miniSAPserver stream announcer. This is not about VLC!
Forum rules
Please do not post VLC related questions in this forum category. See the Forum Rules for more information.
cyplp
New Cone
New Cone
Posts: 2
Joined: 22 Jul 2004 09:01
Location: france (64)
Contact:

trouble with perl and telnet

Postby cyplp » 22 Jul 2004 09:32

Hello

I need to manage some vls streamers by the telnet interface.

So I write a perl script for manage the server and I can't read the reply of telnet

code example :

Code: Select all

#!/usr/bin/perl use strict; use warnings; use Net::Telnet (); my $t; $t = new Net::Telnet(Port => 9999); #Prompt => '/\@vls>/'); $t->open("192.168.0.166"); $t->buffer; $t->waitfor('/Login:/'); $t->print("bozo"); $t->waitfor('/Password:/'); $t->print("bozo"); $t->print("help"); my @toto = $t->waitfor('/\@vls>/'); print "toto : @toto\n"; my @lines = $t->cmd("help"); print "lines : @lines\n"; $t->print("logout");
and I get this

Code: Select all

cyp@cyp:~$ perl telnet-test.pl toto : bozo @vls> command timed-out at telnet-test.pl line 28 cyp@cyp:~$

and I sniff the communication , I saw the reply and I don't understand why I can't read the reply :(
Logiciels Libres à Pau : http://www.paulla.asso.fr

cyplp
New Cone
New Cone
Posts: 2
Joined: 22 Jul 2004 09:01
Location: france (64)
Contact:

Postby cyplp » 06 Aug 2004 12:24

the next source code works ...

Code: Select all

#!/usr/bin/perl use strict; use warnings; use Net::Telnet (); my $t; $t = new Net::Telnet(Port => 9999); $t->open("192.168.0.166"); $t->waitfor('/Login:/'); $t->print("bozo"); $t->waitfor('/Password:/'); $t->print("bozo"); $t->waitfor('/\@vls>/'); $t->print("help"); my @toto = $t->waitfor('/\@vls>/'); print "toto : @toto\n"; $t->print("logout");
Logiciels Libres à Pau : http://www.paulla.asso.fr


Return to “VideoLAN Server and miniSAPserver”

Who is online

Users browsing this forum: No registered users and 33 guests