• 4091阅读
  • 1回复

QTCPServer调用listen()失败打印出地址无效是怎么回事? [复制链接]

上一主题 下一主题
离线电动游星
 

只看楼主 倒序阅读 楼主  发表于: 2016-05-31
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.  



离线mrsq

只看该作者 1楼 发表于: 2016-12-24
我也遇到相同问题,请问解决了吗??
快速回复
限100 字节
 
上一个 下一个