电动游星 |
2016-05-31 17:47 |
QTCPServer调用listen()失败打印出地址无效是怎么回事?
if(! server->listen(QHostAddress(ip),port)) { qDebug()<<server->errorString(); return; } 打印出来的错误信息是:The address is not available 【不是代码问题,也不是IP地址和端口号的填写问题】。另外一台机子上正常运行,换成win10的机子就不行
Google出来有人遇到相同的问题是这么解决的,是怎么回事:
Problem Solved, there was nothing wrong in the code, it was issues with my WLAN i have manual ip for WLAN, which was not working for my app , i got mac of device bind with an ip in DHCP, now device get ip from DHCP and every thing is good.
|
|