MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
全部  文件 函数 变量 枚举 枚举值 宏定义  
plain_communicator.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Wangyunlai on 2023/06/25.
13//
14
15#pragma once
16
17#include <vector>
18
19#include "net/communicator.h"
20
27{
28public:
30 virtual ~PlainCommunicator() = default;
31
32 RC read_event(SessionEvent *&event) override;
33 RC write_result(SessionEvent *event, bool &need_disconnect) override;
34
35private:
36 RC write_state(SessionEvent *event, bool &need_disconnect);
37 RC write_debug(SessionEvent *event, bool &need_disconnect);
38 RC write_result_internal(SessionEvent *event, bool &need_disconnect);
39
40protected:
41 std::vector<char> send_message_delimiter_;
42 std::vector<char> debug_message_prefix_;
43};
负责与客户端通讯
Definition: communicator.h:42
struct event & read_event()
libevent使用的数据,参考server.cpp
Definition: communicator.h:77
与客户端进行通讯
Definition: plain_communicator.h:27
std::vector< char > debug_message_prefix_
调试信息前缀
Definition: plain_communicator.h:42
RC write_result(SessionEvent *event, bool &need_disconnect) override
在任务处理完成后,通过此接口将结果返回给客户端
Definition: plain_communicator.cpp:158
std::vector< char > send_message_delimiter_
发送消息分隔符
Definition: plain_communicator.h:41
表示一个SQL请求
Definition: session_event.h:32