查看完整版本: [-- QTCPServer调用listen()失败打印出地址无效是怎么回事? --]

QTCN开发网 -> Qt基础编程 -> QTCPServer调用listen()失败打印出地址无效是怎么回事? [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

电动游星 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.  




mrsq 2016-12-24 11:03
我也遇到相同问题,请问解决了吗??


查看完整版本: [-- QTCPServer调用listen()失败打印出地址无效是怎么回事? --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled