Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt5 discard udp datagram without reading.

Qt5 discard udp datagram without reading.

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 840 Views 2 Watching
  • 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
    JulienD
    wrote on last edited by JulienD
    #1

    Hello,

    Context:
    If a server receive two much data, its strategy is to discard the packets.

    Question:
    Is it possible to discard a UDP datagram and still get notified for the next ones?
    The goal is to minimze the memory needed by an application to face offending packets.

    I would like to avoid to have to read them (because I will discard them anyway). But this should only concern one -offending- udp datagram.

    Alternatively, is reading 1 byte sufficient?

    Thanks

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

      Hi,

      From QUdpSocket::readDatagram's documentation setting maxSize to 0 will discard the datagram.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JulienD
        wrote on last edited by
        #3

        ooops.. Missed that line.

        Thank you

        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