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. readyRead() with multiple streams

readyRead() with multiple streams

Scheduled Pinned Locked Moved Unsolved General and Desktop
readyread
2 Posts 2 Posters 1.9k 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.
  • O Offline
    O Offline
    OliverBJ01
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      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