- Documentation
- Reference manual
- Packages
- SWI-Prolog C-library
- library(socket): Network socket (TCP and UDP) library
- Socket predicate reference
- 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
- Socket predicate reference
- library(socket): Network socket (TCP and UDP) library
- SWI-Prolog C-library
- bypass_proxy(+Boolean)
- Defaults to
false
. Iftrue
, do not attempt to use any proxies to obtain the connection - nodelay(+Boolean)
- Defaults to
false
. Iftrue
, set nodelay on the resulting socket usingtcp_setopt(Socket, nodelay)
- domain(+Domain)
- One of‘inet’or
inet6
. When omitted we use host_address/2 withtype(stream)
and try the returned addresses in order.
The +,+,- mode is deprecated and does not support proxies. It behaves like tcp_connect/4, but creates a stream pair (see stream_pair/3).
Address | is either a Host:Port term or a file name (atom or string). The latter connects to an AF_UNIX socket and requires unix_domain_socket/1. |
- Errors
proxy_error(tried(ResultList))
is raised by mode (+,-,+) if proxies are defines by proxy_for_url/3 but no proxy can establsh the connection. ResultList contains one or more terms of the formfalse(Proxy)
for a hook that simply failed orerror(Proxy, ErrorTerm)
for a hook that raised an exception.- See also
library(http/http_proxy)
defines a hook that allows to connect through HTTP proxies that support theCONNECT
method.