46 lines
993 B
C++
46 lines
993 B
C++
//
|
|
// Created by dongl on 23-7-4.
|
|
//
|
|
|
|
#ifndef IM2_MESSAGEMGR_H
|
|
#define IM2_MESSAGEMGR_H
|
|
|
|
|
|
#include <string>
|
|
#include "agreement.h"
|
|
#include "session.h"
|
|
|
|
class MessageMgr {
|
|
public:
|
|
virtual ~MessageMgr();
|
|
|
|
public:
|
|
/**
|
|
* 接受消息
|
|
* @param request const std::string 消息包原始二进制数据
|
|
*/
|
|
static void receive(const std::string& packet);
|
|
/**
|
|
* 已服务器为主体 的 发送消息
|
|
* @param response const std::string 消息包原始二进制数据
|
|
*/
|
|
static void send(const std::string& packet);
|
|
|
|
/**
|
|
* 接受消息
|
|
* @param request agreement_request 解析好的消息协议
|
|
*/
|
|
static void receive(const agreement_request& request);
|
|
/**
|
|
* 已服务器为主体 的 发送消息
|
|
* @param response agreement_response 解析好的消息协议
|
|
*/
|
|
static void send(const agreement_response& response);
|
|
|
|
private:
|
|
static class session* session;
|
|
};
|
|
|
|
|
|
#endif //IM2_MESSAGEMGR_H
|