The ShellConnection class receives commands over a TCP connection and sends responses back to the client.
Commands are received one per line, and responses are sent in RFC 2821-style response chunks. Every command can send multiple response chunks. Intermediate response chunks have a status code of 100, and can occur more than once. The final chunk has a status code has a 200, 4xx or 500 status code and is exactly one line long. If the command was successful, the status code is 200 and the response text is "OK". If the command was not successful (its return code was not 0), the status code is 400 + return code. If the comand resulted in an exception, the status code is 500.
Example (positive response to help command):
100-The following commands are available: 100-bundles (ls, ss) 100-services (lss) 100-start 100-stop ... 100-set 100 Enter <command> --help for more information about a command 200 OK
Example (negative response to login command):
Direct Base Classes: Poco::Net::TCPServerConnection
STATUS_INTERMEDIATE = 100
STATUS_OK = 200
STATUS_GOODBYE = 201
STATUS_CLIENT_ERROR = 400
STATUS_CLIENT_USAGE = 401
STATUS_CLIENT_DENIED = 403
STATUS_SERVER_ERROR = 500
Creates the ShellConnection.
Destroys the ShellConnection.
See also: Poco::Runnable::run()
const void * pSender,
Poco::OSP::BundleEvent & ev
Close the underlying socket if our bundle is stopping.
static int statusFor(
std::string & message
Creates a suitable status code and response message for the command's exit code.