(html (head (title "sph-lib (sph server)") (link (@ (rel "stylesheet") (type "text/css") (href "/css/sph.css"))) (meta (@ (name "viewport") (content "width=device-width,initial-scale=1"))) #f) (body () (div (@ (class top)) (nav (a (@ (href "/")) "start") ", " (a (@ (href "/feed.xml")) "feed")) "") (div (@ (class "middle")) (div (@ (class mtime) (title "last modification time of the current page")) "2023-04-05") (section (h1 "(sph server)") (div (p "a generic socket data processing server that uses a thread-pool for parallel request processing.") (p "part of " (a (@ (href "../../sph-lib.html")) "sph-lib")) ((section (@ (class "library-description")) (h1 "library description") (div (p "starting the server with server-listen makes it listen on an existing or newly created socket.") (p "if there is a new connection on the socket, a user supplied procedure is called with a client port to receive and send data"))) (section (@ (class "library-name")) (h1 "module name") (p "(sph server)")) (section (@ (class "library-exports")) (h1 "exported bindings") (div (div (@ (class "doc-bindings")) (div (@ (id "doc-b-" "server-default-port") (class "doc-b")) (div (span (@ (class "type")) "variable") ": " (span (@ (class "name")) "server-default-port")) "" "") (div (@ (id "doc-b-" "server-listen") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "server-listen") " " (span (@ (class "first-sig")) "handle-request socket #:parallelism #:exception-key ->")) (div (@ (class "rest-sig")) (div "procedure:{port:client -> unspecified} port:socket [#:key parallelism integer/false] -> unspecified")) (div (@ (class "description")) (("listen for new connections on socket and call handle-request with a input/output port for the client." (br) "handle-request is called in the next free thread in a thread-pool." (br) "the server is stopped when it receives the signal SIGINT or SIGTERM." (br) "by default all exceptions are catched, printed and the server continues listening." (br) "this can be changed with giving a different exception-key, which is passed to catch," (br) "for example one that will never be matched")))) (div (@ (id "doc-b-" "server-socket") (class "doc-b")) (div (span (@ (class "type")) "procedure") ": " (span (@ (class "name")) "server-socket") " " (span (@ (class "first-sig")) "address #:port #:type #:protocol #:set-options #:non-blocking ->")) "" (div (@ (class "description")) (("create a socket with default options. the socket type is inferred" (br) "from the address, which can be an ip4 or ip6 address (tcp) or a filesystem path (unix socket)")))) (div (@ (id "doc-b-" "sph-server-description") (class "doc-b")) (div (span (@ (class "type")) "variable") ": " (span (@ (class "name")) "sph-server-description")) "" "")))))))) ()))