now like a http server
change max_n to max connection number