some changes about SIGPIPE
add select() support for my socket server so that the server can run in single process/thread