code: private void bindEndpoints(ZMQ.Socket socket, Iterable<String> ipAddresses, Map<String, ZMQ.Socket> endpoints, SocketType socketType) {
          xlogger.entry(ipAddresses, endpoints, socketType);
  
  
          for (String ipAddress : ipAddresses) {
              final StringBuilder endpoint = new StringBuilder("tcp://").append(ipAddress).append(":*");
  
  
              int port = socket.bind(endpoint.toString());
  
              //replace * with actual port
              endpoint.deleteCharAt(endpoint.length() - 1).append(port);
              endpoints.put(endpoint.toString(), socket);
              logger.debug("bind ZMQ socket {} for {}", endpoint.toString(), socketType);
          }
  
          xlogger.exit();
      }
docs: Binds given socket types to the list of addresses
  
  @param socket
  @param ipAddresses
  @param endpoints
  @param socketType