From 11f4ae1946693cf5f46e8d0ed26494c490155e76 Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Wed, 12 Apr 2017 00:46:08 -0400 Subject: [PATCH] More updates. --- Hermes/server.rkt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Hermes/server.rkt b/Hermes/server.rkt index 4b590db..d3039d3 100644 --- a/Hermes/server.rkt +++ b/Hermes/server.rkt @@ -47,7 +47,7 @@ (display "Broadcast thread started!\n") (semaphore-post stdout) (let loopb [] - (sleep 0.5) ;; wait 30 secs before beginning to broadcast + ; (sleep 0.5) ;; wait 30 secs before beginning to broadcast (broadcast) (loopb))))) (lambda () @@ -166,7 +166,7 @@ (lambda () (semaphore-wait messages-s) - (if (not (null? messages)) + (cond [(not (null? messages)) (begin (map (lambda (ports) (displayln (first messages) (get-output-port ports)) @@ -180,10 +180,11 @@ ;; current state of messages and connections ;messages ;connections - (displayln "Message broadcasted")) - (begin (semaphore-wait stdout) - (display "No message to display\n") - (semaphore-post stdout))) + (displayln "Message broadcasted"))] + ) + ; (begin (semaphore-wait stdout) + ; (display "No message to display\n") + ; (semaphore-post stdout))) ;;; -- NO LONGER IN USE --- TO BE DELETED ; Approach one was to broadcast via thread mailboxes