socket/4

socket(+ DOMAIN,+ TYPE,+ PROTOCOL,- SOCKET)*

Corresponds to the BSD system call socket. Create a socket for domain DOMAIN of type TYPE and protocol PROTOCOL. Both DOMAIN and TYPE should be atoms, whereas PROTOCOL must be an integer. The new socket object is accessible through a descriptor bound to the variable SOCKET.

The current implementation of YAP accepts socket domains AF_INET and AF_UNIX. Socket types depend on the underlying operating system, but at least the following types are supported: SOCK_STREAM and SOCK_DGRAM (untested in 6.3).