--fix a mistake for last commit:
when read/write socket returning EAGAIN/EINTR, try MAX_RW_TRIES times is not enough. (try 1024 times use less than 1ms on my computer).  now it return timeout when another condition is present: used more than SOCKET_RW_TIME_OUT time, and SOCKET_RW_TIME_OUT=3s.