PDA

View Full Version : QTcpSocket vs QProcess



denton17
5th November 2010, 10:47
Hi there,

I am trying to create a frontend for a library, and I want to have an interactive session, so something like QOctave for the GNU Octave if you know. You type a command and u get the response.
The way they are doing it is creating a process running the GNU Octave and interact with it.

So my question is this: Should I create a process and run the executable of the library, and interact with it or just connect at the server the executable is running and interact with it.

What are the advantages and disadvantages of each method

tbscope
5th November 2010, 11:41
A library doesn't run on itself. You need to link it to an executable program.

denton17
5th November 2010, 12:26
yes i know that , my mistake i meant frontend for executable

tbscope
5th November 2010, 13:01
Does the backend send data via a socket (either local, tcp, ...)?
If not, how would you set up the backend to send the data over a socket?

Does the backend print all the needed information?
Does it accept input from a standard input during execution?

If you write both backend and frontend I suggest you write a little test of the possible techniques you can use and decide which you like the best or gives you the best results.

denton17
5th November 2010, 14:03
hi thanks for ur replies,


Well to be more specific here is my situation:

In one terminal i can invoke the executable normal or with parameters such as -H (for accepting network connections) and -P for the port.

So at the moment I am able to connect via telnet ssh at the running server of the executable send commands and get feedback. So what I want now is to create a gui using Qt to do that, and dont use telnet and etc.
Also the executable has an API which i can use to connect via my application but the problem is that with this API i cant have an interactive session, which is what I really want.

thats why I am asking should I go with QTcpSocket or invoke a process

I hope I am more clear.