/***** (C) Copyright, Shenzhen SUNWIN Intelligent Co.,Ltd. ******source file**** * File name : main.cpp * Author : ShengYin Li * Brief : ******************************************************************************** * modify * Version Date Author Described * V1.00 2021/04/1 ShengYin Li Created *******************************************************************************/ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sdc_common.h" #include "tcpEpoll.h" #include "sdc.h" #include "inifile.h" #include "md5.h" #include "device/deviceGas.h" #include "dataType/NettyClientCommandEnum.h" #include "dataType/NettyClientResultMsg.h" #include "dataType/NettyServerCommandEnum.h" #include "dataType/NettyServerResultMsg.h" #include "dataType/RecDeviceCommand.h" #include "dataType/RecDeviceInfo.h" #include "dataType/SendLogin.h" #include "dataType/SendHeartBeat.h" #include "dataType/SendDevice.h" #include "dataType/SendBird.h" class tcpSerEpoll: public tcpEpoll { private: int _tproxy_fd; int _socket_fd; struct sockaddr_in servaddr; const char* _path; const std::string config_src = "../config/config.ini"; bool handleAccept(); int start(); bool init(const char* path, const char * filter); void handleEvents(epoll_event * events, int num, char * buf, int &buf_len); bool doEpoll(); public: tcpSerEpoll(); ~tcpSerEpoll(); std::string m_serverIp = "192.168.31.95"; int m_serverPort = 8080; std::string m_usr; std::string m_pwd; string m_serverName = "web"; std::string m_vpnIp; std::string m_cameraIp; int getSocket_fd(); int getTproxy_fd(); static void* insert_pth(void *); bool connect(string idName, const char* ip, int port); bool connect(); void allClose(); int lanch(); }; /******** (C) Copyright, Shenzhen SUNWIN Intelligent Co.,Ltd. ******** End *****/