@Override
  public void connect() {
    if (socket == null) {
      socket = SocketIOImpl.create(this, host, port);
    }

    if (ConnectionState.CLOSED != getConnectionState()) {
      throw new IllegalStateException("Connection isn't closed!");
    }
    socket.connect();
  }