Answer the question
In order to leave comments, you need to log in
Asynchronous python server?
I am writing a server for a game. But I can't figure out how to make it multi-threaded.
for example, if you only needed to work with one client, you could simply write:
import socket
sock = socket.socket()
sock.bind(('', 9090))
sock.listen(1)
conn, addr = sock.accept()
while True:
data = conn.recv(1024)
if not data:
break
conn.close()
Answer the question
In order to leave comments, you need to log in
Use aiohttp, development of one of the authors of asyncio Andrey Svetlov
QuickStart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question