[SOLVED] QTcpServer::listen randomly fails
-
Hi,
I am looking for some clues why QTcpServer::listen (apparently) randomly fails. I am using Ubuntu 64bit 14.04, Qt5.3.2
I am listening on localhost:50000. From the command line I can see that this address is free, however sometimes QTcpServer::listen just fails.
Has anyone ever encountered this? Or can anyone point me in the right direction?
Greetings,
t3685
-
What is the error it throws ? Are u restarting your server frequently ?
-
-
when the bind fails, just call QTCPServer.errorString(...). This will return the last error occurred. I'm suspecting either your interfaces are not up when you give bind or port you are binding is already used by some other process. errorString() should clear the dust.
-
Port you are specifying might have used by other process before your program binds or your program itself may be doing the bind twice within short interval. I suspect the first issue.