The function open-tcp-stream connects to a server and returns a stream (of type socket-stream). The stream is then used for communication through the socket using the standard Lisp I/O functions.
connect-to-tcp-server can also be used, especially if you want to subclass socket-stream.
For examples illustrating simple write and read on a socket, see:
(example-edit-file "capi/applications/chat.lisp") (example-edit-file "capi/applications/chat-client.lisp")
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:24