|
Kyoto Tycoon
|
Replication client. More...
#include <ktremotedb.h>
Public Types | |
| enum | Option { WHITESID = 1 << 0 } |
| Opening options. More... | |
Public Member Functions | |
| ReplicationClient () | |
| Default constructor. | |
| bool | open (const std::string &host="", int32_t port=DEFPORT, double timeout=-1, uint64_t ts=0, uint16_t sid=0, uint32_t opts=0) |
| Open the connection. | |
| bool | close () |
| Close the connection. | |
| char * | read (size_t *sp, uint64_t *tsp) |
| Read the next message. | |
| bool | alive () |
| Check whether the connection is alive. | |
Replication client.
| kyototycoon::ReplicationClient::ReplicationClient | ( | ) | [explicit] |
Default constructor.
| bool kyototycoon::ReplicationClient::open | ( | const std::string & | host = "", |
| int32_t | port = DEFPORT, |
||
| double | timeout = -1, |
||
| uint64_t | ts = 0, |
||
| uint16_t | sid = 0, |
||
| uint32_t | opts = 0 |
||
| ) |
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. |
| ts | the maximum time stamp of already read logs. |
| sid | the server ID number. |
| opts | the optional features by bitwise-or: ReplicationClient::WHITESID to fetch messages whose server ID number is the specified one only. |
Close the connection.
| char* kyototycoon::ReplicationClient::read | ( | size_t * | sp, |
| uint64_t * | tsp | ||
| ) |
Read the next message.
| sp | the pointer to the variable into which the size of the region of the return value is assigned. |
| tsp | the pointer to the variable into which the time stamp is assigned. |
Check whether the connection is alive.
1.7.6.1