15 lines
323 B
C++
15 lines
323 B
C++
#include "mytcpserver.h"
|
|
|
|
MyTcpServer::MyTcpServer(QObject *parent)
|
|
: QObject{parent}
|
|
{
|
|
Server=new QTcpServer();
|
|
connect(Server,&QTcpServer::newConnection,this,&MyTcpServer::OnConnected);
|
|
Server->listen(QHostAddress(LocalIP),LocalPort);
|
|
}
|
|
|
|
void MyTcpServer::OnConnected()
|
|
{
|
|
qDebug()<<"Connected";
|
|
}
|