[server] Replace implementation of select().