docs: protected synchronized ServerSocket initServerSocket() throws IOException, RetryableChannelException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "ServerSocket called, new ServerSocket needs to be created");
          }
          TCPChannelConfiguration channelConfig = tcpChannel.getConfig();
  
          IOException bindError = null;
          BindInfo earlyBind = portBoundEarly(channelConfig.getPort());
  
          if (earlyBind == null) {
              InetSocketAddress socketAddress = null;
  
              if (channelConfig.getHostname() == null) {
                  socketAddress = new InetSocketAddress((InetAddress) null, channelConfig.getPort());
              } else {
                  socketAddress = new InetSocketAddress(channelConfig.getHostname(), channelConfig.getPort());
              }
  
              if (!socketAddress.isUnresolved()) {
                  serverSocket = openServerSocket();
  
                  // receieve buffer size for accepted sockets is set on serverSocket,
                  // send buffer size is set on individual sockets
  
                  if ((channelConfig.getReceiveBufferSize() >= TCPConfigConstants.RECEIVE_BUFFER_SIZE_MIN)
                      && (channelConfig.getReceiveBufferSize() <= TCPConfigConstants.RECEIVE_BUFFER_SIZE_MAX)) {
                      serverSocket.setReceiveBufferSize(channelConfig.getReceiveBufferSize());
                  }
                  if (!channelConfig.getSoReuseAddress()) {
                      //Forced re-use==false custom property
                      try {
                          attemptSocketBind(socketAddress, false);
                      } catch (IOException e) {
                          // no FFDC
                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                              Tr.debug(tc, "Forced re-use==false bind attempt failed, ioe=" + e);
                          }
                          bindError = e;
                      }
                  } else {
                      //re-use==true (default)
                      // try the standard startup attempts
                      try {
                          attemptSocketBind(socketAddress, false);
                          //If we are not on Windows and the bind succeeded, we should set reuseAddr=true
                          //for future binds.
                          if (!TCPFactoryConfiguration.isWindows()) {
                              this.serverSocket.setReuseAddress(true);
                              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                  Tr.debug(tc, "ServerSocket reuse set to true to allow for later override");
                              }
                          }
                      } catch (IOException ioe) {
                          // See if we got the error because the port is in waiting to be cleaned up.
                          // If so, no one should be accepting connections on it, and open should fail.
                          // If that's the case, we can set ReuseAddr to expedite the bind process.
                          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                              Tr.debug(tc, "ServerSocket bind failed on first attempt with IOException: " + ioe.getMessage());
                          }
                          bindError = ioe;
                          try {
                              String hostName = channelConfig.getHostname();
                              if (hostName == null) {
                                  hostName = "localhost";
                              }
                              InetSocketAddress testAddr = new InetSocketAddress(hostName, channelConfig.getPort());
                              // PK40741 - test for localhost being resolvable before using it
                              if (!testAddr.isUnresolved()) {
                                  SocketChannel testChannel = SocketChannel.open(testAddr);
                                  // if we get here, socket opened successfully, which means
                                  // someone is really listening
                                  // so close connection and don't bother trying to bind again
                                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                      Tr.debug(tc, "attempt to connect to port to check listen status worked, someone else is using the port!");
                                  }
                                  testChannel.close();
                              } else {
                                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                      Tr.debug(tc, "Test connection addr is unresolvable; " + testAddr);
                                  }
                              }
                          } catch (IOException testioe) {
                              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                  Tr.debug(tc, "attempt to connect to port to check listen status failed with IOException: " + testioe.getMessage());
                              }
                              try {
                                  // open (or close) got IOException, retry with reuseAddr on
                                  attemptSocketBind(socketAddress, true);
                                  bindError = null;
  
                              } catch (IOException newioe) {
                                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                                      Tr.debug(tc, "ServerSocket bind failed on second attempt with IOException: " + newioe.getMessage());
                                  }
                                  bindError = newioe;
                              }
                          }
                      }
                  }
  
                  if (bindError == null) {
                      // listen port can be different than config port if configed port is '0'
                      listenPort = serverSocket.getLocalPort();
                  } else {
                      String displayableHostName = channelConfig.getDisplayableHostname();
  
                      // add in the exception message to help in problem diagnostics without tracing
                      Tr.error(tc, TCPChannelMessageConstants.BIND_ERROR,
                               new Object[] { channelConfig.getChannelData().getExternalName(), displayableHostName, String.valueOf(channelConfig.getPort()),
                                              bindError.getMessage() });
  
                      throw new RetryableChannelException(bindError.getMessage());
                  }
  
              } else { // unresolved socket address
                  String displayableHostName = channelConfig.getDisplayableHostname();
                  Tr.error(tc, TCPChannelMessageConstants.LOCAL_HOST_UNRESOLVED,
                           new Object[] { channelConfig.getChannelData().getExternalName(), displayableHostName, String.valueOf(channelConfig.getPort()) });
  
                  throw new RetryableChannelException(new IOException("local address unresolved"));
              }
  
          } else {
              // this port was bound earlier by a different service
              Exception e = earlyBind.getBindException();
              if (e == null) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Found early bind, setting serverSocket and listenPort");
                  }
  
                  serverSocket = earlyBind.getServerSocket();
                  // listen port can be different than config port if configed port is '0'
                  listenPort = serverSocket.getLocalPort();
              } else {
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Early Bind generated the following exception: " + e);
                  }
  
                  // add in the exception message to help in problem diagnostics without tracing
                  Tr.error(tc, TCPChannelMessageConstants.BIND_ERROR,
                           new Object[] { channelConfig.getChannelData().getExternalName(), earlyBind.getHostname(), String.valueOf(earlyBind.getPort()), e.getMessage() });
  
                  if (e instanceof IOException) {
                      throw (IOException) e;
                  }
                  if (e instanceof RetryableChannelException) {
                      throw (RetryableChannelException) e;
                  }
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "new ServerSocket successfully created");
          }
  
          return this.serverSocket;
      }