docs: public Connection connect() throws IOException {
          Connection connection;
          synchronized (this) {
              if(shutdown) throw ProtocolLogger.ROOT_LOGGER.channelClosed();
              connection = this.connection;
              if(connection == null) {
                  connection = connectTask.connect();
                  if(connection == null) {
                      throw ProtocolLogger.ROOT_LOGGER.channelClosed();
                  }
                  boolean ok = false;
                  try {
                      // Connection opened notification
                      final ConnectionOpenHandler openHandler = connectTask.getConnectionOpenedHandler();
                      openHandler.connectionOpened(connection);
                      ok = true;
                      this.connection = connection;
                      connection.addCloseHandler(new CloseHandler<Connection>() {
                          @Override
                          public void handleClose(Connection closed, IOException exception) {
                              onConnectionClose(closed);
                          }
                      });
                  } finally {
                      if(!ok) {
                          StreamUtils.safeClose(connection);
                      }
                  }
              }
          }
          return connection;
      }