code: public final ConnectFuture connect(SocketAddress remoteAddress,
              SocketAddress localAddress, IoSessionInitializer<? extends ConnectFuture> sessionInitializer) {
          if (isDisposing()) {
              throw new IllegalStateException("Already disposed.");
          }
  
          if (remoteAddress == null) {
              throw new NullPointerException("remoteAddress");
          }
  
          if (!getTransportMetadata().getAddressType().isAssignableFrom(
                  remoteAddress.getClass())) {
              throw new IllegalArgumentException("remoteAddress type: "
                      + remoteAddress.getClass() + " (expected: "
                      + getTransportMetadata().getAddressType() + ")");
          }
  
          if (localAddress != null
                  && !getTransportMetadata().getAddressType().isAssignableFrom(
                          localAddress.getClass())) {
              throw new IllegalArgumentException("localAddress type: "
                      + localAddress.getClass() + " (expected: "
                      + getTransportMetadata().getAddressType() + ")");
          }
  
          if (getHandler() == null) {
              if (getSessionConfig().isUseReadOperation()) {
                  setHandler(new IoHandler() {
                      public void exceptionCaught(IoSession session,
                              Throwable cause) throws Exception {
                          // Empty handler
                      }
  
                      public void messageReceived(IoSession session,
                              Object message) throws Exception {
                          // Empty handler
                      }
  
                      public void messageSent(IoSession session, Object message)
                              throws Exception {
                          // Empty handler
                      }
  
                      public void sessionClosed(IoSession session)
                              throws Exception {
                          // Empty handler
                      }
  
                      public void sessionCreated(IoSession session)
                              throws Exception {
                          // Empty handler
                      }
  
                      public void sessionIdle(IoSession session, IdleStatus status)
                              throws Exception {
                          // Empty handler
                      }
  
                      public void sessionOpened(IoSession session)
                              throws Exception {
                          // Empty handler
                      }
                  });
              } else {
                  throw new IllegalStateException("handler is not set.");
              }
          }
  
          return connect0(remoteAddress, localAddress, sessionInitializer);
      }
docs: {@inheritDoc}