docs: private boolean open() throws IOException
      {
          assert (fd == null);
  
          //  Resolve the address
          if (addr == null) {
              throw new IOException("Null address");
          }
  
          addr.resolve(options.ipv6);
  
          Address.IZAddress resolved = addr.resolved();
          if (resolved == null) {
              throw new IOException("Address not resolved");
          }
  
          SocketAddress sa = resolved.address();
          if (sa == null) {
              throw new IOException("Socket address not resolved");
          }
  
          //  Create the socket.
          if (options.selectorChooser == null) {
              fd = SocketChannel.open();
          }
          else {
              fd = options.selectorChooser.choose(resolved, options).openSocketChannel();
          }
  
          // On some systems, IPv4 mapping in IPv6 sockets is disabled by default.
          // Switch it on in such cases.
          // The method enableIpv4Mapping is empty. Still to be written
          if (resolved.family() == StandardProtocolFamily.INET6) {
              TcpUtils.enableIpv4Mapping(fd);
          }
  
          // Set the socket to non-blocking mode so that we get async connect().
          TcpUtils.unblockSocket(fd);
  
          //  Set the socket buffer limits for the underlying socket.
          if (options.sndbuf != 0) {
              TcpUtils.setTcpSendBuffer(fd, options.sndbuf);
          }
          if (options.rcvbuf != 0) {
              TcpUtils.setTcpReceiveBuffer(fd, options.rcvbuf);
          }
  
          // Set the IP Type-Of-Service priority for this socket
          if (options.tos != 0) {
              TcpUtils.setIpTypeOfService(fd, options.tos);
          }
  
          // TODO V4 Set a source address for conversations
          if (resolved.sourceAddress() != null) {
              //            SocketChannel bind = channel.bind(resolved.sourceAddress());
              //            if (bind == null) {
              //                return false;
              //            }
          }
  
          //  Connect to the remote peer.
          boolean rc;
          try {
              rc = fd.connect(sa);
              if (rc) {
                  //  Connect was successful immediately.
              }
              else {
                  //  Translate error codes indicating asynchronous connect has been
                  //  launched to a uniform EINPROGRESS.
                  errno.set(ZError.EINPROGRESS);
              }
          }
          catch (IllegalArgumentException e) {
              // this will happen if sa is bad.  Address validation is not documented but
              // I've found that IAE is thrown in openjdk as well as on android.
              throw new IOException(e.getMessage(), e);
          }
  
          return rc;
  
      }