Fixed hanging due to socket error
Merge pull request #6 from ipoddubny/fix_connreset

Fixed hanging due to socket error
so far so good