Use select to rewrite echo server.