Boolean attributes like canConnect are hard to understand when you see a method invocation. Can you create a separated method to test connectivity?