| // TestBase64Server.cpp : Simple XMLRPC server example. Usage: TestBase64Server serverPort
|
| # pragma warning(disable:4786) // identifier was truncated in debug info
|
| // No arguments, result is Base64-encoded pngnow.png data.
|
| class TestBase64 : public XmlRpcServerMethod
|
| TestBase64(XmlRpcServer* s) : XmlRpcServerMethod("TestBase64", s) {}
|
| void execute(XmlRpcValue& params, XmlRpcValue& result)
|
| std::ifstream infile("pngnow.png", std::ios::binary);
|
| infile.open("../pngnow.png", std::ios::binary);
|
| result = "Could not open file pngnow.png";
|
| XmlRpcValue::BinaryData& data = result;
|
| std::cerr << "Read " << n << " bytes from pngnow.png\n";
|
| } TestBase64(&s); // This constructor registers the method with the server
|
| int main(int argc, char* argv[])
|
| std::cerr << "Usage: TestBase64Server serverPort\n";
|
| int port = atoi(argv[1]);
|
| //XmlRpc::setVerbosity(5);
|
| // Create the server socket on the specified port
|
| // Wait for requests indefinitely
|