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


2.34.3.3 Socket operations

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

Function: socket-accept socket

Wait for an incoming connection request, and return a fresh connected client socket.

Function: socket-send socket bv
Function: socket-send socket bv flags

Send a binary data block to a socket and return the sent data size.

flags may specify the procedure’s behaviour. If flags is omitted: the default value must be the result of evaluating the form:

(message-type none)
Function: socket-recv socket size
Function: socket-recv socket size flags

Receive a binary data block from a socket. If a zero–length bytevector is returned: it means the peer connection is closed.

flags may specify the procedure’s behaviour. If flags is omitted, the default value must be the result of evaluating the form:

(message-type none)
Function: socket-shutdown socket how

Shutdown a socket. how must be one of the following constants: *shut-rd*, *shut-wr*, *shut-rdwr*.

Function: socket-close socket

Close a socket. The procedure should not shutdown the given socket: to shutdown a socket socket-shutdown should be called explicitly.

For Vicare: it is safe to apply multiple times this function to the same socket object; the first time the socket is closed, subsequent times nothing happens. This function is automatically applied to every socket object returned by make-client-socket and make-server-socket whenever such objects are garbage collected.

Function: socket-descriptor socket

This function is a Vicare extension. Return an exact integer representing the underlying socket descriptor; such integer can be used as argument to every POSIX function accepting socket descriptors.


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