用Qt4.5.2编了个程序侦听本地地址指定端口的UDP数据
使用了rcvudpSocket->bind(localhostip, PORT);
然后:
connect(rcvudpSocket, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams()));
最后用
while (rcvudpSocket->hasPendingDatagrams()) 处理数据。
在windows下运行正常
但是移植到Linux(fedora10)下无法进入到hasPendingDatagrams
不知道是什么问题?
Linux下发送UDP正常,也通过tcpdump看到需要接收的UDP包了,但是程序收不到?
有遇到类似问题的吗?谢谢