The Lambda Lab
/
projects
/
sam.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
P2P chat works.
[sam.git]
/
sam.scm
diff --git
a/sam.scm
b/sam.scm
index
c3dcbe6
..
29da169
100644
(file)
--- a/
sam.scm
+++ b/
sam.scm
@@
-79,7
+79,6
@@
(define local-queue (make-fifo))
(define (send-message address . message)
(define local-queue (make-fifo))
(define (send-message address . message)
- (print "send-message: Sending " message " to " address)
(apply (if (address-local? address)
send-local-message
send-network-message)
(apply (if (address-local? address)
send-local-message
send-network-message)
@@
-96,7
+95,7
@@
(uri (address->uri address))
(packet (with-output-to-string
(lambda ()
(uri (address->uri address))
(packet (with-output-to-string
(lambda ()
- (
print
(cons address message))))))
+ (
write
(cons address message))))))
(udp-bind! s #f 0)
(udp-connect! s
(uri-host uri)
(udp-bind! s #f 0)
(udp-connect! s
(uri-host uri)
@@
-131,7
+130,6
@@
(udp-bind! s #f sam-port)
(let loop ()
(let-values (((n str) (udp-recv s 1024)))
(udp-bind! s #f sam-port)
(let loop ()
(let-values (((n str) (udp-recv s 1024)))
- (print "network-listener: Received " n " bytes over network: " str)
(match (with-input-from-string str read)
((address message ...)
(apply send-message (cons address message)))
(match (with-input-from-string str read)
((address message ...)
(apply send-message (cons address message)))
@@
-159,7
+157,6
@@
(define (start-console)
(let loop ()
(let ((reader (next-reader)))
(define (start-console)
(let loop ()
(let ((reader (next-reader)))
- (print "console: received next reader: " reader)
(##sys#thread-block-for-i/o! (current-thread) 0 #t)
(thread-yield!)
(send-message reader (read-line)))
(##sys#thread-block-for-i/o! (current-thread) 0 #t)
(thread-yield!)
(send-message reader (read-line)))