fix to TcpClient to detect connection failures

@financeCoding