def server(port): print("Server starting") raw_sock = socket(AF_INET, SOCK_STREAM) raw_sock.bind(("", port)) raw_sock.listen(5) sock = Socket(raw_sock) while True: client, addr = yield sock.accept() yield NewTask(handle_client(client, addr))
def server(port): print "Server starting" rawsock = socket(AF_INET, SOCK_STREAM) rawsock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) rawsock.bind(("", port)) rawsock.listen(1024) sock = Socket(rawsock) while True: client, addr = yield sock.accept() yield NewTask(handle_client(client, addr))
def server(port): print "Server starting" rawsock = socket(AF_INET,SOCK_STREAM) rawsock.setsockopt(SOL_SOCKET,SO_REUSEADDR,1) rawsock.bind(("",port)) rawsock.listen(1024) sock = Socket(rawsock) while True: client,addr = yield sock.accept() yield NewTask(handle_client(client,addr))