Compare commits

...

2 commits

Author SHA1 Message Date
j
a117cad720 listen on IPv6 2023-10-12 12:50:05 +01:00
j
4e6a8d03f6 remove sleep 2023-10-12 12:44:26 +01:00

View file

@ -45,6 +45,7 @@ class Handler(BaseRequestHandler):
response = b'WAITING'
queue = True
socket = self.request[1]
logger.debug("respond to %s: %s", self.client_address[0], response)
socket.sendto(response, self.client_address)
if queue:
self.server.player.queue.put('')
@ -140,8 +141,6 @@ def main():
peer = (args.peer, args.peer_port)
time.sleep(10)
DEBUG = args.debug
if DEBUG:
log_format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s'
@ -150,8 +149,9 @@ def main():
os.chdir(base)
player = get_player(fullscreen=not args.window)
server = ThreadingUDPServer(('0.0.0.0', args.port), Handler)
listen = '::' if ':' in args.peer else ''0.0.0.0''
server = ThreadingUDPServer((listen, args.port), Handler)
server.allow_reuse_address = True
server.player = Player(peer, player, args.playlist, args.prefix)
player.register_key_binding('q', server.q_binding)