Error handling
Merge pull request #12 from sergions80/patch-1

Socket error handling