Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I need a help to run a C codes in remote chip from PHP - TCP/IP socket connection request with some arguments?

Thanks in advance.

Regards,

A Kumar

share|improve this question
Have you tried to use netcat? – Alexander Mihailov 10 hours ago

2 Answers

Using socket you can't run any c application directly .You need to call that executable to run .

My idea is you can run another client application on remote and send some data to socket and in remote the client will receive the message based on which it can run he application.

share|improve this answer

Method 1:
You can receive the file sent from client and save it to disk.
Then, you may use system to compile the file received.
The last step, you run it, use the system again.

But i am not suggest you do that, as it may be dangerous, you never know what the code does. It may deletes all your files in the disk. What's more, the libs the code depend on may not be installed.

Method2:
use the loadable library:
1. all the code sent to server is implement a generic interface
2. pre-compile the code to loadable library
2. server save the code to disk
3. server load the library and call the generic interface
More about loadable library, please check it out.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.