12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #pragma once
- #include <signal.h>
- #include <iostream>
- #include "Util/logger.h"
- #include "Network/TcpClient.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
|