29 #ifndef _LEVIN_BASE_H_
30 #define _LEVIN_BASE_H_
34 #define LEVIN_SIGNATURE 0x0101010101012101LL
70 #define LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED 0
71 #define LEVIN_DEFAULT_MAX_PACKET_SIZE 100000000
73 #define LEVIN_PACKET_REQUEST 0x00000001
74 #define LEVIN_PACKET_RESPONSE 0x00000002
77 #define LEVIN_PROTOCOL_VER_0 0
78 #define LEVIN_PROTOCOL_VER_1 1
80 template<
class t_connection_context = net_utils::connection_context_base>
94 #define LEVIN_ERROR_CONNECTION -1
95 #define LEVIN_ERROR_CONNECTION_NOT_FOUND -2
96 #define LEVIN_ERROR_CONNECTION_DESTROYED -3
97 #define LEVIN_ERROR_CONNECTION_TIMEDOUT -4
98 #define LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL -5
99 #define LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED -6
100 #define LEVIN_ERROR_FORMAT -7
102 #define DESCRIBE_RET_CODE(code) case code: return #code;
117 return "unknown code";
Non-owning sequence of data. Does not deep copy.
#define DESCRIBE_RET_CODE(code)
#define LEVIN_ERROR_CONNECTION
#define LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL
#define LEVIN_ERROR_CONNECTION_DESTROYED
#define LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED
#define LEVIN_ERROR_CONNECTION_NOT_FOUND
#define LEVIN_ERROR_FORMAT
#define LEVIN_ERROR_CONNECTION_TIMEDOUT
const char * get_err_descr(int err)
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
unsigned __int64 uint64_t
uint32_t m_protocol_version
bool m_have_to_return_data
bool m_have_to_return_data
virtual void on_connection_new(t_connection_context &context)
virtual int notify(int command, const epee::span< const uint8_t > in_buff, t_connection_context &context)=0
virtual void on_connection_close(t_connection_context &context)
virtual ~levin_commands_handler()
virtual void callback(t_connection_context &context)
virtual int invoke(int command, const epee::span< const uint8_t > in_buff, std::string &buff_out, t_connection_context &context)=0