You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#ifndef STRUCTDEFINEMYSLEF_H
|
|
#define STRUCTDEFINEMYSLEF_H
|
|
|
|
|
|
#include <QString>
|
|
#include <QHostAddress>
|
|
|
|
struct MyPairNetwork
|
|
{
|
|
public:
|
|
MyPairNetwork(){};
|
|
MyPairNetwork(QString a,int b,QString c,int d){
|
|
localIP = a;
|
|
localPort = b;
|
|
remoteIP = c;
|
|
remotePort = d;
|
|
localAddr.setAddress(localIP);
|
|
remoteAddr.setAddress(remoteIP);
|
|
}
|
|
private:
|
|
QString localIP;
|
|
quint16 localPort;
|
|
QHostAddress localAddr;
|
|
QString remoteIP;
|
|
quint16 remotePort;
|
|
QHostAddress remoteAddr;
|
|
|
|
public:
|
|
void setLocalIP(QString ip){
|
|
localIP = ip;
|
|
localAddr.setAddress(localIP);
|
|
}
|
|
void setLocalPort(quint16 port){
|
|
localPort = port;
|
|
}
|
|
void setRemoteIP(QString ip){
|
|
remoteIP = ip;
|
|
remoteAddr.setAddress(remoteIP);
|
|
}
|
|
void setRemotePort(quint16 port){
|
|
remotePort = port;
|
|
}
|
|
QString getLocalIP(){return localIP;}
|
|
quint16 getLocalPort(){return localPort;}
|
|
QHostAddress getLocalAddr(){return localAddr;}
|
|
QString getRemoteIP(){return remoteIP;}
|
|
quint16 getRemotePort(){return remotePort;}
|
|
QHostAddress getRemoteAddr(){return remoteAddr;}
|
|
};
|
|
|
|
|
|
#endif // STRUCTDEFINEMYSLEF_H
|