26 lines
690 B
C++
26 lines
690 B
C++
#pragma once
|
|
|
|
#include "abstract_coder.hpp"
|
|
#include "abstract_tcp_connect.hpp"
|
|
#include "tcp_buffer.hpp"
|
|
#include <memory>
|
|
|
|
|
|
namespace tinyrpc {
|
|
class TcpClient;
|
|
class ClientTcpConnection : public AbstractTcpConnection {
|
|
|
|
public:
|
|
ClientTcpConnection(int fd, Reactor& reactor, TcpClient& cli);
|
|
~ClientTcpConnection();
|
|
TcpBuffer& getSendBuffer() {return m_writeBuffer;}
|
|
bool getResPackageData(const std::string& msg_req, std::shared_ptr<AbstractData>& pb_struct);
|
|
void process() override;
|
|
|
|
private:
|
|
TcpClient& m_client;
|
|
std::unordered_map<std::string, std::shared_ptr<AbstractData>> m_respond_datas; // cli
|
|
|
|
};
|
|
|
|
} |