31 lines
592 B
C
31 lines
592 B
C
|
|
#ifndef CIDWUDP_H
|
||
|
|
#define CIDWUDP_H
|
||
|
|
|
||
|
|
#include <QObject>
|
||
|
|
#include <QUdpSocket>
|
||
|
|
#include <QList>
|
||
|
|
#include <QHostAddress>
|
||
|
|
#include "global.h"
|
||
|
|
|
||
|
|
class CIDWUdp:public QObject
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
public:
|
||
|
|
explicit CIDWUdp(QObject *parent = 0);
|
||
|
|
~CIDWUdp();
|
||
|
|
void Init();
|
||
|
|
void UserOnlineInfo(QByteArray datagram,QString strIP);
|
||
|
|
private slots:
|
||
|
|
void ReadPendingDatagrams();
|
||
|
|
signals:
|
||
|
|
void RetSignal(QString,QString strIP);
|
||
|
|
void IpSignal(QString);
|
||
|
|
|
||
|
|
private:
|
||
|
|
QUdpSocket *m_pUdpSocket;
|
||
|
|
QHostAddress m_targetaddr;//ip
|
||
|
|
quint16 m_targetport;//端口号
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // CIDWUDP_H
|