I want to be able to send a packet to all devices connected to a socket object (server-side).
Below is an example of what I’m trying to achieve (server-side):
import socket
def server(s): # s is the socket object
while True:
c, addr = s.accept()
msg = c.recv(4096).decode()
# some way of sending what is received to all hosts connected?