Fixed Unhandled Exception when socket closed
Merge pull request #4 from Gorniv/mtdev

Fixed Unhandled Exception when socket closed