Handle jsonrpc errors.
This commit is contained in:
parent
668b23c5b0
commit
7deee3240b
2 changed files with 41 additions and 4 deletions
|
@ -25,6 +25,7 @@
|
|||
#define __CLIENT_H__
|
||||
|
||||
|
||||
#include <jansson.h>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
|
@ -61,6 +62,8 @@ private:
|
|||
void close();
|
||||
void connect(struct sockaddr *addr);
|
||||
void parse(char *line, size_t len);
|
||||
void parseNotification(const char *method, const json_t *params);
|
||||
void parseResponse(int64_t id, const json_t *result, const json_t *error);
|
||||
void setState(SocketState state);
|
||||
|
||||
static void onAllocBuffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf);
|
||||
|
@ -73,6 +76,8 @@ private:
|
|||
|
||||
char *m_host;
|
||||
IClientListener *m_listener;
|
||||
int64_t m_retries;
|
||||
int64_t m_sequence;
|
||||
size_t m_recvBufPos;
|
||||
SocketState m_state;
|
||||
struct addrinfo m_hints;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue