Stoyan Georgiev

Greenhorn
+ Follow
since Sep 07, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Stoyan Georgiev

Thanks, it is working now.
The secret is(or atleast it's working for me) to invoke method rather than new class. I saw that in your example is also like this.
Thanks again
20 years ago
So i have a DefaultListModel and when i have a new socket connection to teh server ,some information about the client is added to the List model. After that � wont when i click twise over one of the objec to open a new frame application(chat console)

if(e.getClickCount() == 2){
int index = list.locationToIndex(e.getPoint());
Client client = (Client) StoringData.vector.get(index);

try {
new Console(client);

so far everiting is OK, but when i start >2 Console applications only the last one is active and i cant work with the others.
Any ideas why is like this and any prepositions
20 years ago
Scenario :
client --> server . I want the client to connect to the server via socket and from there to initialize telnet(ftp) to the client again. The server is getting as a input some comands from the client and executing them, as a responce it sending data to the client.

BufferedReader incoming = new BufferedReader (new InputStreamReader(socket.getInputStream()));

String str=null;

while (( str = incoming.readLine())!= null ){

Runtime rt = Runtime.getRuntime();
Process proc = rt.exec((str).toString());
InputStream stdin = proc.getInputStream();
// and deal it the data

so if i want to execute cmd.exe /C dir --everyting is fine and i can see the responce from the client side but when i try for example to execute telnet IPAddress -- there is no responce (on boat sides - client and server)
Probably there is a specific way to deal with proc.getOutputStream(); to show the responce of the server but i can't find it.
Any ideas