Hi everyone, My application requires me to open a terminal from my program and connect to a remote device and then send and receive commands and responses from tht terminal.
I have used:
My problem is tht a terminal is opening as required...it even starts the telnet session...but before one could start typing the cmds,it abruptly closes(the pgm exits with a value 0).Can someone tell me why this is happening and how i should approach this pbm? Thanks in advance, Thejaswini.
P.S: i did not know where to post this...hope am not posting it in the wrong forum. [ January 17, 2006: Message edited by: thejaswini ramesh ]
This works fine with me. I don't know what is wrong with your setup. Any ways what are you trying to achieve by opening up the telnet session and ask the user to type?
If you want to communicate with the remote device better use sockets.
The Apache Commons project includes support for Telnet protocol among others. You might look at how they do it. If you absolutely HAVE to use exec, then you will have to handle the standard in and out streams inside Java because exec grabs control of them - which is probably the source of your problem. Bill [ January 18, 2006: Message edited by: William Brogden ]
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it: