9.3 Dispatching Server
The Web Server is just a configuration of a dispatching server. This dispatching server component is useful on its own.
9.3.1 Dispatching Server Signatures
The web-server/private/dispatch-server-sig library provides two signatures.
dispatch-server^ : signature |
The dispatch-server^ signature is an alias for web-server^.
Runs the server and returns a procedure that shuts down the server.
(serve-ports ip op) → void
ip : input-port?
op : output-port?
Serves a single connection represented by the ports ip and op.
dispatch-server-config^ : signature |
Specifies the port to serve on.
Passed to tcp-accept.
Passed to tcp-accept.
Specifies the initial timeout given to a connection.
(read-request c p port-addresses) → any/c
c : connection?
p : port?
port-addresses : port-addresses?
Defines the way the server reads requests off connections to be passed to dispatch.
dispatch : dispatcher?
How to handle requests.
9.3.2 Dispatching Server Unit
The web-server/private/dispatch-server-unit module provides the unit that actually implements a dispatching server.
|
Runs the dispatching server config in a very basic way, except that it uses Connection Manager to manage connections.