code: private void initializeSocketOption() {
      try {
  
        socket.setTcpNoDelay(options.tcpNoDelay);
  
        if (options.tcpKeepAlive) {
          socket.setKeepAlive(true);
        }
        if (options.tcpRcvBuf != null) {
          socket.setReceiveBufferSize(options.tcpRcvBuf);
        }
        if (options.tcpSndBuf != null) {
          socket.setSendBufferSize(options.tcpSndBuf);
        }
        if (options.tcpAbortiveClose) {
          socket.setSoLinger(true, 0);
        }
      } catch (Exception e) {
        logger.debug("Failed to set socket option", e);
      }
    }
docs: InitializeSocketOption.