Just read beej and implement any kind of client/server you care to.

The server just waits for a connection, then receives a command telling it what to do. It then goes away and does it, and possibly sends back some success/fail.

Then figure out the security implications of what you're doing.