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. Shared UDP

Shared UDP

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.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.
  • A Offline
    A Offline
    Arnaud-DUTARTRE
    wrote on last edited by
    #1

    Hello,

    I am developing a client/server application.

    Clients find the server with a broadcast and the server answer on a specific port.

    Clients could be multiple on the same platform and the creation of the socket is done this way :
    @
    mUDPIn->bind(QHostAddress::Any, UDP_IN_PORT, QAbstractSocket::ShareAddress);
    @

    The first client is able to bind but the second is not: The error indicated that the address is already linked. It prevents from having shared connection on same port.

    So it seems the parameter QAbstractSocket::ShareAddress is not working.

    I have seen a discussion about it starting in September 2013 but did not see any feedback and the bug report is not managed.

    Could you confirm it is not working or indicates a workaround ?

    Best regards
    Arnaud

    “Sometimes I lie awake at night, and ask, 'Where have I gone wrong?' Then a voice says to me, 'This is going to take more than one night.'” C.M. Sc...

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      This is similar to socket address reuse. On Windows this is ignored. Also why do you want the same port# your client sockets ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        You can't bind same port several times on same machine.

        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