1 Star 0 Fork 3

Qiu555/串口调试助手

forked from panda/串口调试助手 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tcpserver.h 892 Bytes
一键复制 编辑 原始数据 按行查看 历史
panda 提交于 2018-06-12 17:48 +08:00 . 加入tcpserver
#ifndef TCPSERVER_H
#define TCPSERVER_H
#pragma once
#include <QTcpServer>
#include <QTcpSocket>
#include<QMap>
class TcpSocket: public QTcpSocket
{
Q_OBJECT
public:
TcpSocket(int socketdesc,QTcpSocket *parent=NULL);
~TcpSocket();
signals:
void signal_recv_data(QByteArray byte,QString ip);
private slots:
void ReadAndParseData();
void SocketError(QAbstractSocket::SocketError socketError);
private:
QString m_recvDataStr;
};
class TcpServer : public QTcpServer
{
Q_OBJECT
public:
TcpServer(const QString ip,int port,QTcpServer *parent=NULL);
~TcpServer();
TcpSocket socket(int index) const { m_socketList.at(index);}
protected:
void incomingConnection(qintptr socketDescriptor);
private slots:
void SocketDisconn();
private:
QList<TcpSocket*> m_socketList;
};
#endif // TCPSERVER_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qiu555/serial_debug_assistant.git
git@gitee.com:qiu555/serial_debug_assistant.git
qiu555
serial_debug_assistant
串口调试助手
master

搜索帮助