► |  | Web Server: PLT HTTP Server

1 | Running the Web Server
2 | Writing Servlets
3 | Extending the Web Server
4 | Troubleshooting and Tips
5 | Acknowledgements
| Index

► | 3 | Extending the Web Server

3.1 | Configuration
3.2 | Setting Up Servlets
3.3 | Dispatchers
3.4 | Web Config Unit
3.5 | Web Server Unit
3.6 | Internal

▼ | 3.6 | Internal

3.6.1 | Timers
3.6.2 | Connection Manager
3.6.3 | Dispatching Server
3.6.4 | Serializable Closures
3.6.5 | Cache Table
3.6.6 | MIME Types
3.6.7 | Serialization Utilities
3.6.8 | URL Param
3.6.9 | Miscellaneous Utilities

On this page:

connection
start-connection-manager
new-connection
kill-connection!
adjust-connection-timeout!

Version: 4.1.4
top← prev up next →

##### 3.6.2`` Connection Manager

(require web-server/private/connection-manager)

"private/connection-manager.ss" provides functionality for managing pairs of input and output ports. We have plans to allow a number of different strategies for doing this.

(struct connection (timer i-port o-port custodian close?))
timer : timer?
i-port : input-port?
o-port : output-port?
custodian : custodian?
close? : boolean?

A connection is a pair of ports (i-port and o-port) that is ready to close after the current job if close? is #t. Resources associated with the connection should be allocated under custodian. The connection will last until timer triggers.

(start-connection-manager) → void

Runs the connection manager (now just the timer manager).

(new-connection |  | timeout |  |  |  |
|  | i-port |  |  |  |
|  | o-port |  |  |  |
|  | cust |  |  |  |
|  | close?) |  | → |  | connection?

timeout : number?
i-port : input-port?
o-port : output-port?
cust : custodian?
close? : boolean?

Constructs a connection with a timer with a trigger of timeout that calls kill-connection!.

(kill-connection! c) → void
c : connection?

Closes the ports associated with c, kills the timer, and shuts down the custodian.

(adjust-connection-timeout! c t) → void
c : connection?
t : number?

Calls reset-timer! with the timer behind c with t.

top← prev up next →