⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 server.cpp

📁 Android实现远程控制PC源代码
💻 CPP
字号:
#include "server.h"
#include "serverthread.h"

Server::Server(MainWindow *m,int p,QHostAddress a)
{
    this->hostAddress=a;
    this->port=p;
    this->mainWindow=m;
    this->clientNum=0;
    this->QTcpServer::listen(hostAddress,quint16(port));
    connect(this,SIGNAL(printText(const char*)),this->mainWindow,SLOT(showText(const char*)));
}

void Server::incomingConnection(int handle)
{
    char ch[]="new connection !";
    emit printText(ch);
    ServerThread *thread=new ServerThread(handle,this,mainWindow,this->clientNum);
    this->clientNum++;
    thread->start();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -