fix infinity loop when client close the socket
Merge pull request #40 from douzifly/master

fix infinity loop when client close the socket