udpSocket = new QUdpSocket(this);
QByteArray datagram = "blog.const.net.cn";
udpSocket->writeDatagram(datagram.data(), datagram.size(), QHostAddress::Broadcast, 45454);
udpSocket->bind(QHostAddress("192.168.1.104"), 45454);
UDP客户端广播
QUdpSocket *udpsocket1 = new QUdpSocket(this);
QByteArray datagram = "http://blog.const.net.cn"; udpsocket1->writeDatagram(datagram.data(),datagram.size(), QHostAddress::Broadcast,ui->spinBox->text().toInt());
UDP客户端发送到指定IP
QUdpSocket *udpsocket1 = new QUdpSocket(this);
QByteArray datagram = "http://blog.const.net.cn"; udpsocket1->writeDatagram(datagram.data(),datagram.size(), QHostAddress("192.168.1.104"),ui->spinBox->text().toInt());
收数据
connect(udpsocket, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams()));
while (udpsocket->hasPendingDatagrams())
{
QByteArray datagram;
datagram.resize(udpsocket->pendingDatagramSize());
QHostAddress sender;
quint16 senderPort;
udpsocket->readDatagram(datagram.data(), datagram.size(), &sender, &senderPort);
qDebug()<<datagram.data()<<datagram.size()<<senderPort<<sender.toString(); //processTheDatagram(datagram);
}
C++ lambda表达式
nVidia的物理系统
UE3客户端服务器GamePlay框架
UE3中Object和Actor的创建与销毁
git-lfs插件
【SpringCloud】Spring Cloud Alibaba 之 Sentinel 持久化规则(三十五)
【SpringCloud】Spring Cloud Alibaba 之 Sentinel 与OpenFeign整合(三十四)
【SpringCloud】Spring Cloud Alibaba 之 Sentinel @SentinelResource使用(三十三)
【SpringCloud】Spring Cloud Alibaba 之 Sentinel热点参数限流与系统自适应限流(三十二)