handle timeouts for socket.read()
Merge pull request #3 from shurshur/master

handle timeouts for socket.read()