Add Connection.
Fix exception type.
Catch sending data exceptions.
Merge pull request #2 from tomwys/master