1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
;; pub/sub with envelope address
;; Note that if you don't insert a sleep, the server will crash with SIGPIPE as soon
;; as a client disconnects. Also a remaining client may receive tons of
;; messages afterward.
(use srfi-18 sqlite3 spiffy)
(define cname "server")
(define total-db-accesses 0)
(define start-time (current-seconds))
;; setup the server here
(server-port 5563)
(define (open-db)
(let* ((dbpath "mockup.db")
(dbexists (file-exists? dbpath))
(db (open-database dbpath)) ;; (never-give-up-open-db dbpath))
(handler (make-busy-timeout 10)))
|
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
;; pub/sub with envelope address
;; Note that if you don't insert a sleep, the server will crash with SIGPIPE as soon
;; as a client disconnects. Also a remaining client may receive tons of
;; messages afterward.
(use srfi-18 sqlite3 spiffy)
(define cname "server")
(define total-db-accesses 0)
(define start-time (current-seconds))
;; setup the server here
(tcp-buffer-size 2048)
(server-port 5563)
(define (open-db)
(let* ((dbpath "mockup.db")
(dbexists (file-exists? dbpath))
(db (open-database dbpath)) ;; (never-give-up-open-db dbpath))
(handler (make-busy-timeout 10)))
|