Common Lisp Package: NET4CL

README:

FUNCTION

Public

FIND-SERVICE (SERVICE-NAME &OPTIONAL (PROTOCOL tcp))

Return the port number associated to a particular service. This is looked up in /etc/services.

GET-ADDRESS-BY-HOSTNAME (HOST)

Return the IP address that belongs to HOST or NIL if unknown. Return a vector of type (VECTOR (UNSIGNED-BYTE 8) 4).

GET-HOSTNAME-BY-ADDRESS (IP-ADDR)

Return the hostname associated to IP-ADDR, or NIL if unknown. IP-ADDR is supposed to be a vector of type (VECTOR (UNSIGNED-BYTE 8) 4).

MAKE-SERVER-SOCKET (DESCRIPTION)

Make a server socket based on DESCRIPTION. If it's a string it's a service name. If it's a number must be a port number. If it's a pathname it's the Unix domain (local) socket.

OPEN-SOCKET (&KEY PATHNAME HOST PORT BUFFERING (ELEMENT-TYPE '(UNSIGNED-BYTE 8)))

Return a connected socket. Either specify PATHNAME (for a Unix domain socket), or HOST and PORT, for an internet socket. Buffering is shamefully Lisp implementation dependent.

Undocumented

GET-HOST-NAME

PARSE-IP-ADDRESS (STRING)

Private

CLOSE-REAL-SOCKET (SOCKET)

Close a system specific socket. Not the class defined in this module.

OPEN-INET-SOCKET (HOST PORT BUFFERING ELEMENT-TYPE)

Open a TCP socket to HOST at PORT.

Undocumented

CLOSE-REAL-SERVER-SOCKET (SOCKET)

OPEN-LOCAL-SOCKET (PATHNAME BUFFERING ELEMENT-TYPE)

MACRO

Public

WITH-OPEN-SOCKET ((SOCKET &REST ARGS) &BODY BODY)

Execute BODY in a context where client SOCKET is bound to a connected socket made by calling OPEN-SOCKET with ARGS. Make sure to close the socket upon exit of the code block.

WITH-SERVER-SOCKET ((SOCKET PORT) &BODY BODY)

Execute BODY in a context where client SOCKET is bound to a server socket listening to PORT. Make sure to close the socket upon exit of the code block.

Undocumented

DO-CONNECTIONS ((SOCKET SOCKET-DESCRIPTION &KEY (BUFFERING NONE) (ELEMENT-TYPE ''(UNSIGNED-BYTE 8)) TIMEOUT KEEP-OPEN) &BODY BODY)

GENERIC-FUNCTION

Public

Undocumented

ACCEPT (SERVER-SOCKET &KEY ELEMENT-TYPE BUFFERING TIMEOUT)

CLOSE-SOCKET (SOCKET &KEY ABORT)

SLOT-ACCESSOR

Public

SOCKET-REAL-SOCKET (OBJECT)

System specific socket object.

SOCKET-STREAM (OBJECT)

System specific stream object of socket.

Private

SOCKET-PATHNAME (OBJECT)

Pathname of the Unix domain slocket.

SETFSOCKET-PATHNAME (NEW-VALUE OBJECT)

Pathname of the Unix domain slocket.

SOCKET-STATUS (OBJECT)

Current status of socket. When newly created it's :OPEN. It becomes :CLOSED after a CLOSE-SOCKET.

VARIABLE

Public

Undocumented

*SERVICES-FILE*

CLASS

Private

Undocumented

CONNECTED-SOCKET

INET-SERVER-SOCKET

SERVER-SOCKET

SOCKET

UNIX-SERVER-SOCKET

CONSTANT

Private

Undocumented

+WHITESPACE-CHARS+