Search code examples
pythonsocketsudplanmessenger

How to detect other hosts on LAN messenger using a single UDP port?


As stated in the IP Messenger Help , it uses a UDP Port 2425 to detect other hosts. How does it actually achieves it with a single port??

How do I proceed to achieve this, like say create a socket, then broadcast and all the steps.

Any Ideas and Help would be greatly appreciated..


Solution

    1. Create datagram socket()
    2. bind() the port
    3. prepare packet
    4. sendto() UDP packet to the broadcast (mulicast) address
    5. recvfrom() as many answer as you want