Client class for a structured data remote procedure call. More...
#include <llsdrpcclient.h>
Public Types | |
enum | EPassBackQueue |
Enumeration for tracking which queue to process the response. | |
Public Member Functions | |
bool | call (const std::string &uri, const std::string &method, const std::string ¶meter, LLSDRPCResponse *response, EPassBackQueue queue) |
Call a method on a remote LLSDRPCServer. | |
bool | call (const std::string &uri, const std::string &method, const LLSD ¶meter, LLSDRPCResponse *response, EPassBackQueue queue) |
Call a method on a remote LLSDRPCServer. | |
LLSDRPCClient () | |
Protected Types | |
enum | EState |
Enumeration for tracking client state. | |
Protected Member Functions | |
virtual EStatus | process_impl (const LLChannelDescriptors &channels, buffer_ptr_t &buffer, bool &eos, LLSD &context, LLPumpIO *pump) |
Process the data in buffer. |
Client class for a structured data remote procedure call.
This class helps deal with making structured data calls to a remote server. You can visualize the calls as: response = uri.method(parameter)
where you pass in everything to call
and this class takes care of the rest of the details. In typical usage, you will derive a class from this class and provide an API more useful for the specific application at hand. For example, if you were writing a service to send an instant message, you could create an API for it to send the messsage, and that class would do the work of translating it into the method and parameter, find the destination, and invoke call</call> with a useful implementation of LLSDRPCResponse passed in to handle the response from the network.
LLSDRPCClient::LLSDRPCClient | ( | ) |
bool LLSDRPCClient::call | ( | const std::string & | uri, | |
const std::string & | method, | |||
const std::string & | parameter, | |||
LLSDRPCResponse * | response, | |||
EPassBackQueue | queue | |||
) |
Call a method on a remote LLSDRPCServer.
uri | The remote object to call, eg, http://localhost/usher. If you are using a factory with a fixed url, the uri passed in will probably be ignored. | |
method | The method to call on the remote object | |
parameter | The seriailized parameter to pass into the remote object. | |
response | The object which gets the response. | |
queue | Specifies to call the response on the process or callback queue. |
bool LLSDRPCClient::call | ( | const std::string & | uri, | |
const std::string & | method, | |||
const LLSD & | parameter, | |||
LLSDRPCResponse * | response, | |||
EPassBackQueue | queue | |||
) |
Call a method on a remote LLSDRPCServer.
uri | The remote object to call, eg, http://localhost/usher. If you are using a factory with a fixed url, the uri passed in will probably be ignored. | |
method | The method to call on the remote object | |
parameter | The parameter to pass into the remote object. It is up to the caller to delete the value passed in. | |
response | The object which gets the response. | |
queue | Specifies to call the response on the process or callback queue. |