Results 1 to 2 of 2

Thread: QTcpServer->listen() doesnot need the hostaddress in its argument

  1. #1
    Join Date
    Nov 2007
    Posts
    291
    Thanks
    85
    Thanked 1 Time in 1 Post

    Default QTcpServer->listen() doesnot need the hostaddress in its argument

    hi
    A server will always listens on the local machine .Then why does the function
    bool QTcpServer::listen ( const QHostAddress & address = QHostAddress::Any, quint16 port = 0 )

    takes address as the argument.Can a Server listen on the other computers port.

    Thank you

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTcpServer->listen() doesnot need the hostaddress in its argument

    no, but one machine can have more then only one IP/Network interface.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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.