/usr/local/lib/swipl/library/ext/clib/socket.pl
All Application Manual Name SummaryHelp

  • ext
    • clib
      • socket.pl -- Network socket (TCP and UDP) library
        • socket_create/2
        • tcp_socket/1
        • unix_domain_socket/1
        • tcp_close_socket/1
        • tcp_open_socket/2
        • tcp_open_socket/3
        • tcp_bind/2
        • tcp_listen/2
        • tcp_accept/3
        • tcp_connect/2
        • rewrite_host/3
        • tcp_connect/4
        • tcp_connect/3
        • tcp_select/3
        • try_proxy/4
        • proxy_for_url/3
        • udp_socket/1
        • udp_receive/4
        • udp_send/4
        • tcp_setopt/2
        • tcp_fcntl/3
        • tcp_getopt/2
        • host_address/3
        • tcp_host_to_address/2
        • gethostname/1
        • ip_name/2
        • negotiate_socks_connection/2
      • uid.pl -- User and group management on Unix systems
      • unix.pl
      • syslog.pl -- Unix syslog interface
      • memfile.pl
      • time.pl
      • uri.pl
      • filesex.pl
      • uuid.pl -- Universally Unique Identifier (UUID) Library
      • sha.pl
      • process.pl -- Create processes and redirect I/O
      • hash_stream.pl -- Maintain a hash on a stream
      • md5.pl -- MD5 hashes
      • rlimit.pl
      • mallocinfo.pl -- Memory allocation details
      • crypt.pl
      • udp_broadcast.pl -- A UDP broadcast proxy
      • streampool.pl
 rewrite_host(+HostIn, -HostOut, +Socket) is nondet[multifile, library(socket)]
Allow rewriting the host for tcp_connect/2 and therefore all other predicates to connect a socket.

This hook is currently defined in Windows to map localhost to ip(127,0,0,1) as resolving localhost on Windows is often very slow. Note that we do not want to do that in general as a system may prefer to map localhost to `::1`, i.e., the IPv6 loopback address.