Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. confused while reading Qt Document

confused while reading Qt Document

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 267 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jgxy1123
    wrote on last edited by
    #1

    Hello, All!

    When I read Qt Document, I had some confusion about the member functions of QTcpServer.

    - first, the description of QTcpServer::incomingConnection() says as following:
    The base implementation creates a QTcpSocket, sets the socket descriptor and then stores the QTcpSocket in an internal list of pending connections. Finally newConnection() is emitted.

    - second, the description of QTcpServer::newConnection() is says this:
    This signal is emitted every time a new connection is available, regardless of whether it has been added to the pending connections queue or not.

    So , my question is that when the signal of newConnection() is emitted? before or after the new connection is added in to pendding connections?

    C 1 Reply Last reply
    0
    • J jgxy1123

      Hello, All!

      When I read Qt Document, I had some confusion about the member functions of QTcpServer.

      - first, the description of QTcpServer::incomingConnection() says as following:
      The base implementation creates a QTcpSocket, sets the socket descriptor and then stores the QTcpSocket in an internal list of pending connections. Finally newConnection() is emitted.

      - second, the description of QTcpServer::newConnection() is says this:
      This signal is emitted every time a new connection is available, regardless of whether it has been added to the pending connections queue or not.

      So , my question is that when the signal of newConnection() is emitted? before or after the new connection is added in to pendding connections?

      C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @jgxy1123 A quick look at the source code would indicate that the newConnection() and pendingConnectionAvailable() signals come after the connection is queued.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved