12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /***** (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 <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include <errno.h>
- #include <iostream>
- #include <stdlib.h>
- #include <malloc.h>
- #include <sys/types.h>
- #include <sys/un.h>
- #include <sys/epoll.h>
- #include <sys/uio.h>
- #include <string.h>
- #include <unistd.h>
- #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 *****/
|