Shared UDP



  • 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



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



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.