Close socket connection when destroying instance
Actually display error message
Handle EPIPE properly

Added functionality to properly handle EPIPE error as this would indicate that the remote end has disconnected
Properly handle unable to get address info
Relocated when log is printed
Properly sleep on non-blocking I/O
Test network I/O from client