|
Kyoto Tycoon
|
RPC client. More...
#include <ktrpc.h>
Public Types | |
| enum | ReturnValue { RVSUCCESS, RVENOIMPL, RVEINVALID, RVELOGIC, RVETIMEOUT, RVEINTERNAL, RVENETWORK, RVEMISC = 15 } |
| Return value. More... | |
Public Member Functions | |
| RPCClient () | |
| Default constructor. | |
| ~RPCClient () | |
| Destructor. | |
| bool | open (const std::string &host="", int32_t port=DEFPORT, double timeout=-1) |
| Open the connection. | |
| bool | close (bool grace=true) |
| Close the connection. | |
| ReturnValue | call (const std::string &name, const std::map< std::string, std::string > *inmap=NULL, std::map< std::string, std::string > *outmap=NULL) |
| Call a remote procedure. | |
| const std::string | expression () |
| Get the expression of the socket. | |
| HTTPClient * | reveal_core () |
| Reveal the internal HTTP client. | |
RPC client.
Default constructor.
Destructor.
| bool kyototycoon::RPCClient::open | ( | const std::string & | host = "", |
| int32_t | port = DEFPORT, |
||
| double | timeout = -1 |
||
| ) |
Open the connection.
| host | the name or the address of the server. If it is an empty string, the local host is specified. |
| port | the port numger of the server. |
| timeout | the timeout of each operation in seconds. If it is not more than 0, no timeout is specified. |
| bool kyototycoon::RPCClient::close | ( | bool | grace = true | ) |
Close the connection.
| grace | true for graceful shutdown, or false for immediate disconnection. |
| ReturnValue kyototycoon::RPCClient::call | ( | const std::string & | name, |
| const std::map< std::string, std::string > * | inmap = NULL, |
||
| std::map< std::string, std::string > * | outmap = NULL |
||
| ) |
Call a remote procedure.
| name | the name of the procecude. |
| inmap | a string map which contains the input of the procedure. If it is NULL, it is ignored. |
| outmap | a string map to contain the output parameters. If it is NULL, it is ignored. |
| const std::string kyototycoon::RPCClient::expression | ( | ) |
Get the expression of the socket.
Reveal the internal HTTP client.
1.7.6.1