call an executable on a server from client?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
guzzi_jones
Experienced Solver
Experienced Solver
Posts: 81
Joined: Sun Dec 08, 2013 3:50 am

call an executable on a server from client?

Post by guzzi_jones » Sat May 10, 2014 5:02 pm

I am pretty new to wxwidgets and c++. I have a project where i want to search for files on a server and if a file exists then allow the user to call an executable on the server.
1. open client. click button to :
2. have server look for certain files existance in /home/<folder>/file.zip
2. if the files exist then allow the client to process those files with an executable on the server. : integ <ifile>, report success for failure to the client

Do i need to start to learn about client server programming?
Is there a good tuturial about doing this sort of setup? I did see the socket sticky above too.

If there is someone who could teach me how to do this or help me with it I would consider .5 btc for your troubles.

My current program compiles on Windows 7 or ubuntu, with codeblocks, wixdigets2.8, mingw.
I have the wxwidgets binaries and libpxx binaries required for windows 7 and ubuntu.
A vpn connection is also required.
Thanks as always.

User avatar
doublemax
Moderator
Moderator
Posts: 15283
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: call an executable on a server from client?

Post by doublemax » Sat May 10, 2014 8:32 pm

Do you have total control over the server? E.g. can you install executables and set access rights?

If yes, i'd use a http/cgi approach. Have a webserver with PHP run on the server. From your wxWidgets applications you call certain PHP scripts using wxHttp/wxURL and these scripts can perform the tasks you're describing (looking for files and executing files).
Use the source, Luke!

guzzi_jones
Experienced Solver
Experienced Solver
Posts: 81
Joined: Sun Dec 08, 2013 3:50 am

Re: call an executable on a server from client?

Post by guzzi_jones » Sun May 11, 2014 1:37 am

Yes it is my server. Is there a tutorial or some documentation u could recommend?

Nunki
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 223
Joined: Fri Sep 14, 2012 8:26 am
Location: Kontich, Belgium
Contact:

Re: call an executable on a server from client?

Post by Nunki » Sun May 11, 2014 6:50 pm

You could indeed go for the real client/server programming. Did that some years ago. I'm still using the thing. Simply some server process where you can send linux commands to, once you're connected to it by means of sockets. I can share you the C code. I did not yet translate it into C++. You can find fine examples of this too in textbooks like "UNIX network programming" by Stevens.

guzzi_jones
Experienced Solver
Experienced Solver
Posts: 81
Joined: Sun Dec 08, 2013 3:50 am

Re: call an executable on a server from client?

Post by guzzi_jones » Mon May 12, 2014 12:53 am

Thanks I sent u a pm. I found the book u mentioned on amazon.

guzzi_jones
Experienced Solver
Experienced Solver
Posts: 81
Joined: Sun Dec 08, 2013 3:50 am

Re: call an executable on a server from client?

Post by guzzi_jones » Tue May 13, 2014 12:54 am

This is a pretty good tutorial with some great starter code.
http://www.linuxhowtos.org/C_C++/socket.htm

It even gives you a looping server2.c script with a function to start from.
My function will basically just execute commands that i send the server and return the error level back to the client.

Post Reply