All Manuals > LispWorks® User Guide and Reference Manual > 25 TCP and UDP socket communication and SSL

25.1 Running a server that accepts connections

The function start-up-server starts a new thread which:

  1. Creates a socket, then:
  2. Prepares it (that is, binds it to the address and port and does various other settings) and then:
  3. Waits for connections to it ("accepting connections").

When a connection is made, a programmer-supplied function is called with the new socket. Typically this function create a stream of type socket-stream with this socket, and then uses the stream for communication through the socket using standard Common Lisp I/O functions.

You can also use the Asynchronous I/O API function accept-tcp-connections-creating-async-io-states to accept connections (see 25.8 Asynchronous I/O).


LispWorks® User Guide and Reference Manual - 18 Feb 2025 15:32:07