Skip to content

Commit

Permalink
changed server.ss so that output ports don't buffer; I think this may…
Browse files Browse the repository at this point in the history
… have fixed it

Signed-off-by: Ian McEwen <ianmcorvidae@edithae.hampshire.edu>
  • Loading branch information
ianmcorvidae committed Nov 4, 2009
1 parent 642d0e6 commit cfc30f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server.ss
Expand Up @@ -36,14 +36,13 @@
(define-values (register-client get-output-port-list)
(let ([output-port-list '()])
(values
(λ (port) (file-stream-buffer-mode port 'line) (set! output-port-list (cons port output-port-list)) (write '("server" "text" "Registered.") port) (flush-output port))
(λ (port) (file-stream-buffer-mode port 'none) (set! output-port-list (cons port output-port-list)) (write '("server" "text" "Registered.") port))
(λ () output-port-list))))
;Dispatching text (the function that actually does it)
(define (dispatch name type message)
(for ([port (get-output-port-list)])
(with-handlers (((lambda (exn) #t) (lambda (exn) (ignoring-errors (close-output-port port)) #t)))
(write `(,name ,type ,message) port)
(flush-output port))))
(write `(,name ,type ,message) port))))
;The server! This could possibly be better-named. Anyway, configurable port --
;for now assuming that we want it to just listen on every address. Right now,
;only sending of source really works.
Expand Down

0 comments on commit cfc30f3

Please sign in to comment.