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. Listen all UDP ports for specified address
Forum Updated to NodeBB v4.3 + New Features

Listen all UDP ports for specified address

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 4.2k Views 1 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.
  • U Offline
    U Offline
    usamytch
    wrote on last edited by
    #1

    Good day, colleagues!

    I have a network device with loopback function. I have to send UDP packets to it and receive they back and check. The problem is that device send me packets back to arbitrary UDP port which I can't know beforehand.

    So is it possible to listen all UDP ports for specified address?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      Usually one would listen at port 0.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        You cannot listen on all ports with a single socket.

        If you listen on port 0, on Unix(like) systems, you usually get a random (not yet used) port that this port listens to (cf. "this article":http://compnetworking.about.com/od/tcpip/p/port-numbers-0.htm)

        http://www.catb.org/~esr/faqs/smart-questions.html

        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