sync/timeout to plain sync. Its appropriate given the chat context

This commit is contained in:
Ibrahim Mkusa 2017-04-16 17:32:02 -04:00
parent 7e7edb4a54
commit 6680d7504b
2 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@
; receives input from server and displays it to stdout
(define (receive-messages in)
; retrieve a message from server
(define evt (sync/timeout 60 (read-line-evt in)))
(define evt (sync (read-line-evt in)))
(cond [(eof-object? evt)
(displayln-safe "Server connection closed." error-out-s error-out)

View File

@ -164,7 +164,7 @@
(define (chat_with_client in out)
; deals with queueing incoming messages for server to broadcast to all clients
(define (something-to-say in)
(define evt-t0 (sync/timeout 60 (read-line-evt in 'linefeed)))
(define evt-t0 (sync (read-line-evt in 'linefeed)))
(cond [(eof-object? evt-t0)
(semaphore-wait connections-s)
((c-connections 'remove-ports) in out)
@ -224,7 +224,7 @@
(flush-output out)
(semaphore-post connections-s)]
[else
(displayln-safe evt-t0)
; (displayln-safe evt-t0) debug purposes
(semaphore-wait messages-s)
; evaluate it .
((c-messages 'add) evt-t0)