Skip to content

Instantly share code, notes, and snippets.

import select
import socket
class EchoServer(object):
def __init__(self, reactor):
self.sock = socket.socket()
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sock.bind(('', 8000))
self.sock.listen(2)