新增websocket调试助手集成在nettool中
This commit is contained in:
@@ -1,36 +1,7 @@
|
||||
#ifndef TCPSERVER_H
|
||||
#define TCPSERVER_H
|
||||
|
||||
#include <QtNetwork>
|
||||
|
||||
class TcpClient : public QTcpSocket
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TcpClient(QObject *parent = 0);
|
||||
|
||||
private:
|
||||
QString ip;
|
||||
int port;
|
||||
|
||||
public:
|
||||
void setIP(const QString &ip);
|
||||
QString getIP()const;
|
||||
|
||||
void setPort(int port);
|
||||
int getPort()const;
|
||||
|
||||
private slots:
|
||||
void readData();
|
||||
|
||||
signals:
|
||||
void sendData(const QString &ip, int port, const QString &data);
|
||||
void receiveData(const QString &ip, int port, const QString &data);
|
||||
|
||||
public slots:
|
||||
void sendData(const QString &data);
|
||||
|
||||
};
|
||||
#include "tcpclient.h"
|
||||
|
||||
class TcpServer : public QTcpServer
|
||||
{
|
||||
@@ -41,14 +12,8 @@ public:
|
||||
private:
|
||||
QList<TcpClient *> clients;
|
||||
|
||||
protected:
|
||||
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
|
||||
void incomingConnection(qintptr handle);
|
||||
#else
|
||||
void incomingConnection(int handle);
|
||||
#endif
|
||||
|
||||
private slots:
|
||||
void newConnection();
|
||||
void disconnected();
|
||||
|
||||
signals:
|
||||
@@ -73,7 +38,6 @@ public slots:
|
||||
void remove(const QString &ip, int port);
|
||||
//断开所有连接
|
||||
void remove();
|
||||
|
||||
};
|
||||
|
||||
#endif // TCPSERVER_H
|
||||
|
||||
Reference in New Issue
Block a user