Nominate our 2022 Qt Champions!

readyRead() with multiple streams

  • Hi,
    My code has two streams; one UDP and the other TCP.
    The QUdpSocket emits readyRead() and so does the QTcpSocket when data is received.
    How can I distinguish between data received from the different streams?
    Can I change the name of readyRead() for one of the sockets?

    Thanks, Bernard

  • Lifetime Qt Champion

    You can use two different slots or use the same slot but check what the sender is (you get pointer to the sender calling sender() in the slot).

Log in to reply