hexdata = hashlib.md5("asdf").hexdigest()def authenticator(sock): data = sock.recv(32) if data != hexdata : raise AuthenticationError("unknown source client!") return sock, hexdata
conn = connect(host, port)