And the final suggestion is unicast, twice.
All these methods has their pro's and con's.
Broadcasts will not penetrate routers. You can only send to computers on the same local network.
Multicasts require IGMP subscriptions from the receivers. It very often takes up to a minute before the routers on the path react to the igmp subscription. If you send a multicast on a local network with just switches it becomes a broadcast and no igmp subscription is required.
Unicast is the easiest one and it works always. Just send the data twice.
Code: Select all
from socket import socket
sock = socket()
sock.connect(('1.2.3.4', 1234))
sock.send('Hello world!\n')
sock.close()