Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#26 About TelnetWrapper class..

open
nobody
None
5
2004-07-14
2004-07-14
Anonymous
No

Hi,
I fedup with TelnetWrapper class for making my own
solutions please.................. tell me the write way to
use this class from which i can send command for
execution to the desire tell net server This class is only
able to get me connect to desire telnet server and after
that it totaly stuck.

i am giving my code snippt plz tell me in reply

TelnetWrapper telnet = new TelnetWrapper();
try {
System.out.println("connecting to Telnet Server");
telnet.connect(args[0], 23);
System.out.println("connected to Telnet Server");
// telnet.waitfor("login:");
// System.out.println("login found...");
telnet.send("Username.......");
System.out.println("username sent.");
// telnet.waitfor("password:");
// System.out.println("password received");
telnet.send("PWD...........");
// System.out.println("login to Telnet Server");
telnet.setPrompt("$");
// telnet.waitfor("$");
telnet.send("dumb");
System.out.println(telnet.send("ls -l\r"));
}catch(java.io.IOException e) {
e.printStackTrace();
}

The Out put is only as follows
connecting to Telnet Server
connected to Telnet Server
username sent.

if i remove the commets from the above code it will
remain same what is the problem i dont know bcz i do as
directed in the docs (api) of the application. Is this
whole application uses native telnet programe of the OS
through JNI and there is some needing of some more
settings according to it PLZ let me know i am in great
stuk my sem... will be lost if i do not submit my project
base on this application on time Please help me.

Alok

Discussion