Next: , Previous: , Up: srfi basic-socket spec   [Index]


2.34.3.2 Constructors and predicates

The following bindings are exported by the libraries (srfi :106) and (srfi :106 socket).

Function: make-client-socket node service
Function: make-client-socket node service ai-family
Function: make-client-socket node service ai-family ai-socktype
Function: make-client-socket node service ai-family ai-socktype ai-flags
Function: make-client-socket node service ai-family ai-socktype ai-flags ai-protocol

Return a client socket connected to an Internet address.

The Internet address is identified by node and service. node and service must be strings. Example values for node: ‘"localhost"’, ‘127.0.0.1’. Example values for service: ‘"http"’, ‘"80"’.

The optional arguments may specify the created socket’s behaviour. If the optional arguments are omitted, then the following value should be used as default:

ai-family

Defaults to: *af-inet*.

ai-socktype

Defaults to: *sock-stream*.

ai-flags

Defaults to: (socket-merge-flags *ai-v4mapped* *ai-addrconfig*).

ai-protocol

Defaults to: *ipproto-ip*.

The returned socket may not be closed automatically so it is the users’ responsibility to close it explicitly.

For Vicare: whenever the returned socket object is garbage collected, the function socket-close is automatically applied to it.

Function: make-server-socket service
Function: make-server-socket service ai-family
Function: make-server-socket service ai-family ai-socktype
Function: make-server-socket service ai-family ai-socktype ai-protocol

Return a server socket waiting for connection.

The node argument is the same as the one of make-client-socket. The optional arguments may specify the created socket’s behaviour. If the optional arguments are omitted, then the following value should be used as default:

ai-family

Defaults to: *af-inet*.

ai-socktype

Defaults to: *sock-stream*.

ai-protocol

Defaults to: *ipproto-ip*.

The returned socket may not be closed automatically so it is the users’ responsibility to close it explicitly.

For Vicare: whenever the returned socket object is garbage collected, the function socket-close is automatically applied to it.

Function: socket? obj

Return #t if obj is a socket object, #f otherwise.


Next: , Previous: , Up: srfi basic-socket spec   [Index]