1 Star 0 Fork 13

BCSkill/IPCommDesktop

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
qhttpserver.h 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
DESKTOP-G17U1FM\HELLO 提交于 2020-03-07 17:21 +08:00 . 更新代码
#ifndef QHTTPSERVER_H
#define QHTTPSERVER_H
#include <QObject>
#include <QHostAddress>
#include <QJsonDocument>
#include <QJsonObject>
#include <QDir>
#include <QFile>
#include <QNetworkProxy>
#include <QHostInfo>
#define HTTPSERVER_VERSION_MAJOR 0
#define HTTPSERVER_VERSION_MINOR 1
#define HTTPSERVER_VERSION_PATCH 0
class QTcpServer;
class HttpRequest;
class HttpResponse;
//请求和响应头的表
typedef QHash<QString, QString> HeaderHash;
//状态代码
extern QHash<int, QString> STATUS_CODES;
class QHttpServer : public QObject
{
Q_OBJECT
public:
QHttpServer(quint16 port,QObject *parent=0);
~QHttpServer();
bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
bool listen(quint16 port);
public slots:
void slotThreadListen();
private:
QString decodeURI(QString str);
signals:
void sigApplyGroup(QString groupID);
private slots:
void newConnection();
void onRequest(HttpRequest*, HttpResponse*);
private:
QTcpServer *m_tcpServer;
quint16 m_port;
HttpResponse *m_response;
};
#endif // QHTTPSERVER_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/BCSkill/IPCommDesktop.git
git@gitee.com:BCSkill/IPCommDesktop.git
BCSkill
IPCommDesktop
IPCommDesktop
master

搜索帮助