1 Running the Web Server
2 Scheme Servlets
3 Web Language Servlets
4 Configuration
5 Dispatchers
6 Web Config Unit
7 Web Server Unit
8 Continuation Managers
9 Internal
10 Troubleshooting
11 Acknowledgements
Index
On this page:
9.3.1 Dispatching Server Signatures
dispatch-server^
serve
serve-ports
dispatch-server-config^
port
listen-ip
max-waiting
initial-connection-timeout
read-request
dispatch
9.3.2 Dispatching Server Unit
dispatch-server@
Version: 4.0.2

 

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

 (require web-server/private/dispatch-server-sig)

The web-server/private/dispatch-server-sig library provides two signatures.

dispatch-server^ : signature

The dispatch-server^ signature is an alias for web-server^.

(serve)  (-> void)

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

port : port?

Specifies the port to serve on.

listen-ip : string?

Passed to tcp-accept.

max-waiting : integer?

Passed to tcp-accept.

initial-connection-timeout : integer?

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

 (require web-server/private/dispatch-server-unit)

The web-server/private/dispatch-server-unit module provides the unit that actually implements a dispatching server.

dispatch-server@ : 

(unit/c (tcp^ dispatch-server-config^)

        (dispatch-server^))

Runs the dispatching server config in a very basic way, except that it uses Connection Manager to manage connections.