add select function in server.c