disconnect politely if there are no active assignments
svn: r1076
This commit is contained in:
parent
988dfce4ae
commit
c47b962567
|
@ -238,6 +238,7 @@
|
|||
(let* ([h (connect)]
|
||||
[l (retrieve-active-assignments h)])
|
||||
(when (null? l)
|
||||
(handin-disconnect h)
|
||||
(error 'handin "there are no active assignments"))
|
||||
(set! connection h)
|
||||
(for-each (lambda (assign) (send assignment append assign))
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
(require (lib "mzssl.ss" "openssl"))
|
||||
|
||||
(provide handin-connect
|
||||
handin-disconnect
|
||||
retrieve-extra-fields
|
||||
retrieve-active-assignments
|
||||
submit-assignment
|
||||
|
@ -42,6 +43,10 @@
|
|||
;; Return connection:
|
||||
(make-handin r w))))
|
||||
|
||||
(define (handin-disconnect h)
|
||||
(write+flush (handin-w h) 'bye)
|
||||
(close-handin-ports h))
|
||||
|
||||
(define (retrieve-extra-fields h)
|
||||
(let ([r (handin-r h)] [w (handin-w h)])
|
||||
(write+flush w 'get-extra-fields 'bye)
|
||||
|
|
Loading…
Reference in New Issue
Block a user