I am trying to run a program, the program is EXE file written in C#, it should get input from a client in Java, and write to it (simple TCP/IP) But When it just doesn't work! the program get stuck and don't get any thing from the server But When I run the server alone (EXE from the command), and connect to it with a client, every thing works fine! So, what is the problem with "exec" and why isn't it like running a program from the command ? Thank you
Runtime.exec has a few pitfalls that you need to avoid. In this case it sounds like you may not be handling the input, error and output streams of the child process. You can read all about how to do that in this article.
Amm, but what is the problem? I have done some of the things in the topic you have gave me, but than I can print like only one line, and when sending anther line to the server, it get stuck again like in the first time
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35440
9
posted
0
In that case it would help to see the code you're now using.
Oz Kron
Ranch Hand
Joined: Feb 27, 2007
Posts: 41
posted
0
this is the code Can some one help me out here? Thank you
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35440
9
posted
0
So what happens exactly if you execute this code? Also, you don't seem to be handling the error stream. [ August 13, 2007: Message edited by: Ulf Dittmer ]
Oz Kron
Ranch Hand
Joined: Feb 27, 2007
Posts: 41
posted
0
What happen is for now that if the client send to the server one line, it kind of works, but if there are more lines, it get stuck
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Problem with running a program from Java file