Results 1 to 4 of 4

Thread: tcpServer

  1. #1
    Join Date
    Dec 2015
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows
    Thanks
    1

    Question tcpServer

    my tcpServer is returning null as its own serverAddress 0.0.0.0

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: tcpServer

    There is a reason for that: QTcpServer::serverAddress()

  3. #3
    Join Date
    Dec 2015
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows
    Thanks
    1

    Default Re: tcpServer

    even though the desktop client is getting connected to 127.0.0.1

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: tcpServer

    If QTcpServer::serverAddress() is returning QHostAddress::Null then it is not listening and the client cannot be connecting to it.
    If QTcpServer::serverAddress() is returning QHostAddress::Any, i.e. typically depicted as 0.0.0.0 (IPv4) or :: (IPv6), then it is listening on all interfaces. This will be because you listened without specifying the address of an interface to bind to.

Similar Threads

  1. Replies: 12
    Last Post: 18th April 2011, 16:24
  2. Replies: 1
    Last Post: 17th December 2010, 09:53
  3. passing structure from tcpserver to client
    By aj2903 in forum Qt Programming
    Replies: 4
    Last Post: 22nd December 2008, 11:11

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
  •  
Qt is a trademark of The Qt Company.