Results 1 to 4 of 4

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

  1. #1

    Default QTcpListener cut the connnection when I'm trying to connect with public hostname.

    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 :

    Qt Code:
    1. socket->connectToHost("monsite.ddns.net", 80); // On se connecte au serveur demandé
    To copy to clipboard, switch view to plain text mode 

    I've started to listen on that port :

    Qt Code:
    1. serveur = new QTcpServer(this);
    2. if (!serveur->listen(QHostAddress::Any, 50885))
    To copy to clipboard, switch view to plain text mode 

    Why is the Qt server cut the connection ?

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTcpListener cut the connnection when I'm trying to connect with public hostname.

    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)?

  3. #3

    Default Re: QTcpListener cut the connnection when I'm trying to connect with public hostname.

    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. :/

  4. #4
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTcpListener cut the connnection when I'm trying to connect with public hostname.

    It is not unusual for routers supplied by ISPs to drop such connections.

Similar Threads

  1. Replies: 1
    Last Post: 27th June 2014, 16:29
  2. Replies: 5
    Last Post: 27th January 2014, 22:22
  3. Get hostname from linux system
    By Raadush in forum Qt Programming
    Replies: 4
    Last Post: 13th July 2012, 07:47
  4. Replies: 2
    Last Post: 9th May 2011, 10:38
  5. QSslSocket hostname mismatch
    By eleanor in forum Qt Programming
    Replies: 7
    Last Post: 11th May 2009, 17:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.