Skip to content

Instantly share code, notes, and snippets.

@kunigami

kunigami/server.py

Created Feb 1, 2020
Embed
What would you like to do?
def server(port):
sock = socket(AF_INET,SOCK_STREAM)
sock.setsockopt(SOL_SOCKET,SO_REUSEADDR,1)
sock.bind(("",port))
sock.listen(5)
while True:
yield ReadWait(sock)
client, addr = sock.accept()
yield NewTask(handle_client(client, addr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.