[solved] TcpServer can't work under ubuntu, but works under windows
General and Desktop
4
Posts
2
Posters
1.9k
Views
1
Watching
-
Hello,
I'm trying to create a tcp server. The same code works fine under windows. But under linux, I can't connect at all.
I'm listening QHostAddress::Any, port = 8080. If I type http://localhost:8080/ inside a web browser, the incomingConnection(int socket) function of the class QTcpServer never gets called under. And the connection takes forever.
Do you know what the problem might be?
-
I have solved the issue. The reason is that the interface of incomming function has changed.
My project stated with Qt4.8 and recently moved to Qt5.the incomming function has changed from
void HttpServer::incomingConnection(int)
to
void HttpServer::incomingConnection(qintptr handle)it's not a problem under windows, but under linux, the it never gets called.