The symbolicsocket class is a child class of both the socket and readerprinter classes. The name symbolicsocket comes from symbolic socket. The combination of the readerprinter class with the socket class allows reading from a socket and printing to a socket with the parsing and formatting capabilities of the readerprinter . Two wwlisp processes can hence communicate via a socket with their native syntax. The parser can be customized to interpret specific syntaxes like for example http. Besides the method documented hereafter, all the methods defined in the ancestors socket and readerprinter are available. |
Function Type | subr |
Arguments | a symbolicsocket object |
Return Value | a symbolicsocket object or nil |
Description | once a socket of type stream, seqpacket or rdm has been put in listening mode with socket-listen , symbolicsocket-accept extracts the first connection request on the queue of pending connections, creates a new connected socket with mostly the same properties as the argument, and allocates a new symbolicsocket object which is returned; the newly created symbolicsocket is no longer in the listening state; |
Example | (accept mysock) |
Function Type | subr |
Arguments | the symbol symbolicsocket, a mandatory symbol, a mandatory symbol, a mandatory integer or string, a series of optional pairs of symbols and values |
Return Value | a symbolicsocket object |
Description | never call symbolicsocket-constructor directly but always through make-instance ; the first argument gives the family of the socket: unix, local, inet, inet6, ipx, netlink, x25, ax25, atmpvc, appletalk, packet, of which only unix and inet are implemented as of today; the second argument gives the type of the socket: stream, dgram, seqpacket, raw, rdm, packet, the third argument gives the protocol name or integer number; the following arguments are optional keywords, each followed by a value: the keyword 'maxstring followed by an integer gives the size of the input buffer; the keyword 'filename followed by a string gives the name of the file to create as unix socket; the keyword 'address followed by a string gives the local address or host name; the keyword 'port followed by an integer gives the local port to be used; all the keywords (including family and type values) must evaluate to the expected symbols or be quoted to prevent evaluation; symbolicsocket-constructor calls the methods socket-constructor and readerprinter-constructor ; |
Example | (make-instance symbolicsocket 'inet 'stream 0 'port 9999) |
Function Type | subr |
Arguments | a symbolicsocket object |
Return Value | t |
Description | never call symbolicsocket-destructor directly but always through destroy-instance ; the destructor closes the socket and releases the structures lsocket, lreaderprinter and their buffers, by calling socket-destructor and readerprinter-destructor |
Example | (destroy-instance mysock) |