123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /*
- * @Description: TCPClient
- * @Version: 1.0
- * @Autor: lishengyin
- * @Date: 2021-09-13 17:30:20
- * @LastEditors: lishengyin
- * @LastEditTime: 2021-10-13 09:41:07
- */
- #pragma once
- #include <signal.h>
- #include <iostream>
- #include "Util/logger.h"
- #include "Network/TcpClient.h"
- #include "Util/NoticeCenter.h"
- #include "Notices.h"
- using namespace std;
- using namespace toolkit;
- // dataType
- #include "SendLogin.h"
- #include "NettyServerCommandEnum.h"
- #include "NettyServerResultMsg.h"
- #include "NettyClientResultMsg.h"
- #include "SendLogin.h"
- #include "NettyClientCommandEnum.h"
- #include "SendHeartBeat.h"
- namespace MIVA
- {
- class TCPClient: public TcpClient
- {
- private:
- /* data */
- public:
- typedef std::shared_ptr<TCPClient> Ptr;
- TCPClient():TcpClient() {
- DebugL;
- }
- ~TCPClient(){
- DebugL;
- }
- protected:
- virtual void onConnect(const SockException &ex) override;
- virtual void onRecv(const Buffer::Ptr &pBuf) override;
- virtual void onFlush() override;
- virtual void onErr(const SockException &ex) override;
- virtual void onManager() override;
- private:
- int _nTick = 0;
- std::string _IP;
- int32_t _port;
- };
- } // namespace VIA
|