code: public static SocketFactory getSocketFactory(Configuration conf,
        Class<?> clazz) {
  
      SocketFactory factory = null;
  
      String propValue =
          conf.get("hadoop.rpc.socket.factory.class." + clazz.getSimpleName());
      if ((propValue != null) && (propValue.length() > 0))
        factory = getSocketFactoryFromProperty(conf, propValue);
  
      if (factory == null)
        factory = getDefaultSocketFactory(conf);
  
      return factory;
    }
docs: Get the socket factory for the given class according to its
  configuration parameter
  <tt>hadoop.rpc.socket.factory.class.&lt;ClassName&gt;</tt>. When no
  such parameter exists then fall back on the default socket factory as
  configured by <tt>hadoop.rpc.socket.factory.class.default</tt>. If
  this default socket factory is not configured, then fall back on the JVM
  default socket factory.
  
  @param conf the configuration
  @param clazz the class (usually a {@link VersionedProtocol})
  @return a socket factory