From 2c8407d195bef9219aad357bc2a327c392d38e1a Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Thu, 13 Apr 2017 14:09:40 -0400 Subject: tidied up, removed some unused definitions --- Hermes/TODO | 13 +++++++++++++ Hermes/TODO.txt | 13 ------------- Hermes/server.rkt | 9 ++------- 3 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 Hermes/TODO delete mode 100644 Hermes/TODO.txt diff --git a/Hermes/TODO b/Hermes/TODO new file mode 100644 index 0000000..c1f17fa --- /dev/null +++ b/Hermes/TODO @@ -0,0 +1,13 @@ +1. Create a racket module for commonly used functions +2. Log messages to proper file on server +3. add timestamps to clients messages +4. message parsable? +5. command parsable? +6. keep count of connected clients using object orientation +7. maybe fiddle around with irc library +8. separate main running code from definitions +**9. closure connections, messages, threads. Avoid using set! without an object + like make-account +make own count to deal with closures +10. authentication for databases +11. user can ask for no of logged in users. Server has to parse diff --git a/Hermes/TODO.txt b/Hermes/TODO.txt deleted file mode 100644 index c1f17fa..0000000 --- a/Hermes/TODO.txt +++ /dev/null @@ -1,13 +0,0 @@ -1. Create a racket module for commonly used functions -2. Log messages to proper file on server -3. add timestamps to clients messages -4. message parsable? -5. command parsable? -6. keep count of connected clients using object orientation -7. maybe fiddle around with irc library -8. separate main running code from definitions -**9. closure connections, messages, threads. Avoid using set! without an object - like make-account -make own count to deal with closures -10. authentication for databases -11. user can ask for no of logged in users. Server has to parse diff --git a/Hermes/server.rkt b/Hermes/server.rkt index 216c6e2..59f33d2 100644 --- a/Hermes/server.rkt +++ b/Hermes/server.rkt @@ -1,8 +1,6 @@ #lang racket (require math/base) ;; for random number generation -;; TODO wrap "safer send in a function that takes care of semaphores" - ;; globals ; track number of connections with closure (define (make-count no-count) @@ -20,6 +18,7 @@ [(eq? m 'current-count) current-count])) dispatch) (define c-count (make-count 0)) +; a semaphore to control access to c-count (define c-count-s (make-semaphore 1)) @@ -38,7 +37,7 @@ [(eq? m 'add) add])) dispatch) (define c-connections (make-connections '())) - +; a semaphore to control acess to c-connections (define connections-s (make-semaphore 1)) ;; control access to connections ;; every 5 seconds run to broadcast top message in list @@ -46,10 +45,6 @@ (define messages-s (make-semaphore 1)) ;; control access to messages (define messages '()) ;; stores a list of messages(strings) from currents -(define threads-s (make-semaphore 1)) ;; control access to threads -;; lets keep thread descriptor values -(define threads '()) ;; stores a list of client serving threads as thread descriptor values - ;; Several threads may want to print to stdout, so lets make things civil (define stdout (make-semaphore 1)) -- cgit v1.2.3