161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
+
|
zmq-socket))))
(define (server:client-logout zmq-socket)
(and (socket? zmq-socket)
(cdb:logout zmq-socket *toppath* *my-client-signature*)
(close-socket zmq-socket)))
;;; IS THIS NEEDED?
(define (server:client-setup)
(if (not *toppath*)(setup-for-run))
(let* ((hostinfo (open-run-close tasks:get-best-server tasks:open-db))
(zmq-socket (make-socket 'req)))
(if hostinfo
(begin
(debug:print-info 2 "Setting up to connect to " hostinfo)
|
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
-
+
|
;; (exit) ;; why forced exit?
#f)
;; REPLACE WITH server:client-login
;;
(let ((connect-ok #f)
(conurl (server:make-server-url hostinfo)))
(connect-socket zmq-socket conurl)
(set! connect-ok (cdb:login zmq-socket))
(set! connect-ok (cdb:login zmq-socket *toppath* *my-client-signature*))
(if connect-ok
(begin
(debug:print-info 2 "Logged in and connected to " conurl)
(set! *runremote* zmq-socket)
#t)
(begin
(debug:print-info 2 "Failed to login or connect to " conurl)
|