Throw exception if either bind or connect fails.
Merge pull request #25 from chrisdinn/raise-error-on-connection-failure

Throw exception if either bind or connect fails.