MCPcopy Create free account
hub / github.com/DeNA/HandlerSocket-Plugin-for-MySQL / hstcpcli

Class hstcpcli

libhsclient/hstcpcli.cpp:27–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace dena {
26
27struct hstcpcli : public hstcpcli_i, private noncopyable {
28 hstcpcli(const socket_args& args);
29 virtual void close();
30 virtual int reconnect();
31 virtual bool stable_point();
32 virtual void request_buf_open_index(size_t pst_id, const char *dbn,
33 const char *tbl, const char *idx, const char *retflds, const char *filflds);
34 virtual void request_buf_auth(const char *secret, const char *typ);
35 virtual void request_buf_exec_generic(size_t pst_id, const string_ref& op,
36 const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip,
37 const string_ref& mod_op, const string_ref *mvs, size_t mvslen,
38 const hstcpcli_filter *fils, size_t filslen, int invalues_keypart,
39 const string_ref *invalues, size_t invalueslen);
40 virtual int request_send();
41 virtual int response_recv(size_t& num_flds_r);
42 virtual const string_ref *get_next_row();
43 virtual void response_buf_remove();
44 virtual int get_error_code();
45 virtual std::string get_error();
46 private:
47 int read_more();
48 void clear_error();
49 int set_error(int code, const std::string& str);
50 private:
51 auto_file fd;
52 socket_args sargs;
53 string_buffer readbuf;
54 string_buffer writebuf;
55 size_t response_end_offset; /* incl newline */
56 size_t cur_row_offset;
57 size_t num_flds;
58 size_t num_req_bufd; /* buffered but not yet sent */
59 size_t num_req_sent; /* sent but not yet received */
60 size_t num_req_rcvd; /* received but not yet removed */
61 int error_code;
62 std::string error_str;
63 std::vector<string_ref> flds;
64};
65
66hstcpcli::hstcpcli(const socket_args& args)
67 : sargs(args), response_end_offset(0), cur_row_offset(0), num_flds(0),

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected