0
In python 3.7, when I send a broadcast (via UDP), you need to specify the port. Is there any way I don’t need to do this? Example:
socket.sendto(b, ('<broadcast>', 15000)); #Nesse eu especifico a porta
socket.sendto(b, ('<broadcast>')); #Nesse o programa identifica automaticamente a porta do cliente
data, ip = s1.recvfrom(2048)
ip[1] #É a porta que o servidor deveria enviar o broadcast para o cliente, mas isso iria variar para cada cliente.
I wanted to do it the second way, but he makes that mistake:
TypeError: getsockaddrarg: AF_INET address must be tuple, not str
Without specifying the port, to which of them the message should be sent?
– Woss
I edited on the topic.
– Yan Broetto