Utility to get a name for the thread
Moved the connection blocking code into ConnectionManager. It's cleaner and doesn't require a connection state listener