︙ | | | ︙ | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
*
(import scheme
(prefix sqlite3 sqlite3:)
chicken
data-structures
;; address-info
directory-utils
extras
files
hostinfo
matchable
md5
message-digest
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
*
(import scheme
(prefix sqlite3 sqlite3:)
chicken
data-structures
address-info
directory-utils
extras
files
hostinfo
matchable
md5
message-digest
|
︙ | | | ︙ | |
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
(host #f)
(port #f)
(conn #f)
(cleanup-proc #f)
socket
thread
host-port
)
(define (tt:make-remote areapath)
(make-tt area: areapath))
(define (tt:client-connect-to-server ttdat)
#f)
|
>
|
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
(host #f)
(port #f)
(conn #f)
(cleanup-proc #f)
socket
thread
host-port
(cmd-thread #f)
)
(define (tt:make-remote areapath)
(make-tt area: areapath))
(define (tt:client-connect-to-server ttdat)
#f)
|
︙ | | | ︙ | |
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
(define (tt:start-tcp-server ttdat)
#f)
(define (tt:keep-running ttdat dbfile)
#f)
(define (tt:shutdown-server ttdat)
(let* ((cleanproc (tt-cleanup-proc ttdat)))
(if cleanproc (cleanproc))
;; close up ports here
#f))
(define (wait-and-close uconn)
(thread-join! (tt-srv-cmd-thread uconn))
(tcp-close (tt-srv-socket uconn)))
|
|
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
(define (tt:start-tcp-server ttdat)
#f)
(define (tt:keep-running ttdat dbfile)
#f)
(define (tt:shutdown-server ttdat)
(let* ((cleanproc (tt-srv-cleanup-proc ttdat)))
(if cleanproc (cleanproc))
;; close up ports here
#f))
(define (wait-and-close uconn)
(thread-join! (tt-srv-cmd-thread uconn))
(tcp-close (tt-srv-socket uconn)))
|
︙ | | | ︙ | |
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
(assert conn "FATAL: tt:create-server-registration-file called with no conn, dbfname="dbfname)
(let* ((host (tt-conn-host conn))
(port (tt-conn-port conn))
(servinf (conc servdir"/"host":"port"-"(current-process-id)":"dbfname))
(serv-id (tt:mk-signature areapath))
(clean-proc (lambda ()
(delete-file* servinf))))
(tt-cleanup-proc-set! ttdat clean-proc)
(with-output-to-file servinf
(lambda ()
(print "SERVER STARTED: "host":"port" AT "(current-seconds)" server-id: "serv-id" pid: "(current-process-id))))
serv-id)))
;; find valid server
;; get servers listed, last part of name must match :<dbfname>
|
|
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
(assert conn "FATAL: tt:create-server-registration-file called with no conn, dbfname="dbfname)
(let* ((host (tt-conn-host conn))
(port (tt-conn-port conn))
(servinf (conc servdir"/"host":"port"-"(current-process-id)":"dbfname))
(serv-id (tt:mk-signature areapath))
(clean-proc (lambda ()
(delete-file* servinf))))
(tt-srv-cleanup-proc-set! ttdat clean-proc)
(with-output-to-file servinf
(lambda ()
(print "SERVER STARTED: "host":"port" AT "(current-seconds)" server-id: "serv-id" pid: "(current-process-id))))
serv-id)))
;; find valid server
;; get servers listed, last part of name must match :<dbfname>
|
︙ | | | ︙ | |