4 Star 3 Fork 4

Gitee 极速下载/Tiny-httpd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/Huangtuzhi/Tinyhttpd
克隆/下载
serverthread.cpp 763 Bytes
一键复制 编辑 原始数据 按行查看 历史
Huangtuzhi 提交于 10年前 . new
#include "serverthread.h"
#include "log.h"
ServerThread::ServerThread(QObject *parent):
QThread(parent), m_port(8000), m_address(QHostAddress::AnyIPv6)
{
connect(this, SIGNAL(finished()), this, SLOT(deleteLater()));
}
ServerThread::~ServerThread()
{
delete server;
}
void ServerThread::run()
{
server = new Server();
if(!server->start(m_address, m_port))
{
Log::instance() << "Failed to listen port " << m_port << Log::NEWLINE << Log::FLUSH;
quit();
}
Log::instance()<< "Listening " << m_address.toString() << ":" << m_port << Log::NEWLINE << Log::FLUSH;
exec();
}
void ServerThread::setPort(int port)
{
m_port = port;
}
void ServerThread::setAddress(QHostAddress address)
{
m_address = address;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/Tiny-httpd.git
git@gitee.com:mirrors/Tiny-httpd.git
mirrors
Tiny-httpd
Tiny-httpd
master

搜索帮助