SSH still meets your needs.
Code:
$ ssh -i ~/.ssh/id_dsa example.com "exit 17" ;
$ echo $?
17
-i allows you to specify "identity" - a secret key. If corresponding public key is added to
~/.ssh/authorize_keys of target user on target computer, and identity file is not protected by password, no password entering is required. Also, SSH returns exit code of remote process as own exit code.
Read "man ssh" and "man sshd".
What you need to keep in mind, though, is that the daemon in your design needs a way to be sure that the application is your nice application, not some spammer trying to send spam using your bandwidth. For ssh thi means that you want to protect your identity files well.