32 lines
617 B
C++
32 lines
617 B
C++
#include "network_controller.h"
|
|
|
|
|
|
network_controller::network_controller(network_controller::NetWorkType type, QString ip, uint16_t port)
|
|
{
|
|
if(type == NetWorkType::TYPE_TCP_CLIENT){
|
|
mTcp = new QTcpSocket();
|
|
mCnn = mTcp;
|
|
|
|
QObject::connect(mTcp, SIGNAL(readyRead()), this, SLOT(on_ready_read()));
|
|
QObject::connect(mTcp, SIGNAL(disconnected()), this, SLOT(on_disconect()));
|
|
|
|
mTcp->connectToHost(ip,port,QIODevice::ReadWrite);
|
|
|
|
}
|
|
}
|
|
|
|
network_controller::~network_controller()
|
|
{
|
|
|
|
}
|
|
|
|
void network_controller::on_ready_read()
|
|
{
|
|
|
|
}
|
|
|
|
void network_controller::on_disconect()
|
|
{
|
|
|
|
}
|