PDA

View Full Version : QTcpListener cut the connnection when I'm trying to connect with public hostname.



LaurentDuroisin
3rd January 2016, 11:36
Hi, I've configured a public hostname on no-ip, and then configured my box to redirect the port.

I've also configured the firewall to accept that connection.

But Qt is cutting the connection :



socket->connectToHost("monsite.ddns.net", 80); // On se connecte au serveur demandé


I've started to listen on that port :



serveur = new QTcpServer(this);
if (!serveur->listen(QHostAddress::Any, 50885))


Why is the Qt server cut the connection ?

yeye_olive
3rd January 2016, 12:10
Those two snippets of code, taken out of context, are not enough for us to know what goes wrong. We do not even know if your programs run event loops. How do you know that "Qt is cutting the connection" (whatever that means)?

Have you tried running your client and server on the same machine, using the loopback interface? Have you tried running Qt's network examples (e.g. the fortune server and client)?

LaurentDuroisin
3rd January 2016, 12:21
It seems that's my bbox2 which is blocking the connection.

I configured it to accept input connections on port 80 and redirecting the port 80 to the port 50885 but it still doesn't work. :/

yeye_olive
3rd January 2016, 21:35
It is not unusual for routers supplied by ISPs to drop such connections.