[ prog / sol / mona ]

prog


SchemeBBS [part 2]

84 2022-05-11 12:25

>>83
Requests are handled sequentially in deps/server.scm:create-server:listen with a do loop:

      (printf "Listening to port: ~A" tcp-port)
      (dynamic-wind
        (lambda () unspecific)
        (lambda ()
          (do () ((channel-closed? socket))
            (let ((port (tcp-server-connection-accept socket #t #f)))
              (dynamic-wind
                (lambda () unspecific)
                (lambda () (ignore-errors (lambda () (serve-request port))))
                (lambda () (ignore-errors (lambda () (close-port port))))))))
        (lambda () (channel-close socket)))))
112


VIP:

do not edit these