dbproxy.h
910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/********************************************************************
platform:
author: kevin
copyright: All rights reserved.
purpose:
brief: dbproxy处理
*********************************************************************/
#pragma once
#include <lib_include.h>
#include <service_if.h>
#include "proto_header.h"
class dbproxy_t
{
public:
dbproxy_t();
int handle_cli(const void* data, uint32_t len, el::lib_tcp_peer_info_t* peer_fd_info);
int handle_srv(const void* data, uint32_t len, el::lib_tcp_peer_info_t* peer_fd_info);
proto_head_t head;
int ret;
};
extern dbproxy_t g_dbproxy;
extern server_send_data_t g_send_cli_buf;
/**
* @brief 发送错误码给cli
* @param proto_head_t & head
* @param el::lib_tcp_peer_info_t * peer_fd_info
* @param uint32_t ret
* @return int
*/
extern int g_send_ret(proto_head_t& head, el::lib_tcp_peer_info_t* peer_fd_info, uint32_t ret);