catch exceptions and set socket timeout
Merge pull request #111 from hjacobs/master

catch exceptions and set socket timeout