29 #ifndef _LEVIN_BASE_H_ 30 #define _LEVIN_BASE_H_ 34 #define LEVIN_SIGNATURE 0x0101010101012101LL //Bender's nightmare 70 #define LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED 0 71 #define LEVIN_DEFAULT_MAX_PACKET_SIZE 100000000 //100MB by default 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";
126 #endif //_LEVIN_BASE_H_ #define LEVIN_ERROR_CONNECTION_TIMEDOUT
uint32_t m_protocol_version
#define LEVIN_ERROR_FORMAT
const char * get_err_descr(int err)
#define LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED
bool m_have_to_return_data
Non-owning sequence of data. Does not deep copy.
#define DESCRIBE_RET_CODE(code)
virtual int invoke(int command, const epee::span< const uint8_t > in_buff, std::string &buff_out, t_connection_context &context)=0
virtual int notify(int command, const epee::span< const uint8_t > in_buff, t_connection_context &context)=0
virtual void callback(t_connection_context &context)
unsigned __int64 uint64_t
std::unique_ptr< void, terminate > context
Unique ZMQ context handle, calls zmq_term on destruction.
bool m_have_to_return_data
#define LEVIN_ERROR_CONNECTION_NO_DUPLEX_PROTOCOL
#define LEVIN_ERROR_CONNECTION
virtual void on_connection_new(t_connection_context &context)
#define LEVIN_ERROR_CONNECTION_DESTROYED
virtual void on_connection_close(t_connection_context &context)
#define LEVIN_ERROR_CONNECTION_NOT_FOUND
virtual ~levin_commands_handler()