Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.0.0
-
None
-
Windows 7 + 8.0, Qt 5.0 release, Mingw
-
e3bd06426afce9773fa64afe1a9946647cdec181
Description
QTcpServer fails to start listening, reporting "Unknown error" (QAbstractSocket::UnknownSocketError).
"::bind" call returns false.
Simple program to illustrate (works with Qt 4.8.2)
project file:
QT += core network TARGET = tcpserver CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp
source file:
#include <QCoreApplication> #include <QTcpServer> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QTcpServer srv; bool r = srv.listen(); qDebug() << srv.errorString(); return r; }
After rebuilding network module with debug enabled, I get the following output for the given example program:
WSA error : WSAEFAULT
more details (Система обнаружила недопустимый указатель адреса при попытке использовать в вызове аргумент указателя.)
(unlocalize.com untranslates this message as
The system detected an invalid pointer address in attempting to use a pointer argument in a call.)
QNativeSocketEnginePrivate::nativeBind(0.0.0.0, 0) == false (Unknown error)
If I specify address to listen explitily, or use QHostAddress::AnyIPv4 or QHostAddress::AnyIPv6 server starts:
bool r = srv.listen(QHostAddress("127.0.0.1")); //ok bool r = srv.listen(QHostAddress::AnyIPv4); //ok bool r = srv.listen(QHostAddress::AnyIPv6);// ok bool r = srv.listeb(QHostAddress::Any); //not ok
Attachments
Issue Links
- relates to
-
QTBUG-28971 UDP Socket bind works only partly on Windows Vista (64Bit)
- Closed