Ghostcast Server [portable]

packet_type = PacketType(data[5])

logging.basicConfig(level=logging.INFO) logger = logging.getLogger() ghostcast server

def send_join_ack(self, sock: socket.socket, addr: tuple, session_id: str, client_id: str): """Send join acknowledgment to client""" packet = MAGIC_COOKIE + bytes([PacketType.CLIENT_READY.value]) packet += struct.pack('!I', len(session_id)) + session_id.encode() packet += struct.pack('!I', len(client_id)) + client_id.encode() sock.sendto(packet, addr) packet_type = PacketType(data[5]) logging