- disabled creation of tcp listener in erl.ss, which caused infinite loop

on machines with networking completely turned off
- added find-listener/port, which may be used in the future to enable
  networking explicitly (though erl.ss will need significant mods for that)
- removed mention of distribution in README for demos (i.e., net-pong demo)

- minor bug fix in gui wrapper

- noted that spreadsheet is broken on MacOS

svn: r3403
This commit is contained in:
Greg Cooper 2006-06-18 18:18:35 +00:00
parent 5362ae0f80
commit aaa3cccd89
4 changed files with 15 additions and 36 deletions

View File

@ -21,36 +21,6 @@ pong.ss : A simple pong/air-hockey game. The left paddle moves with
numeric keypad; the right paddle moves with the mouse. The 'r' key
resets the score.
net-pong-*.ss : A networked version of the pong/air-hockey game.
Currently known to work under Linux. To play, open the client on one
machine and the server on another. Execute both (and require if
necessary, depending on language level). Evaluate (self) on each.
Results will be something like:
[client]
> (self)
#3(tid 128.148.38.2:1180 main)
and
[server]
> (self)
#3(tid 128.148.33.71:1178 main)
Now tell each machine about the other:
[client]
> (set-cell! server (make-tid '128.148.33.71 1178 'frtime-heart))
[server]
> (set-cell! client (make-tid '128.148.38.2 1180 'frtime-heart))
Note the differences between the #3(tid ...) output and the (make-tid ...)
commands---there is no colon (:) between the host and port, and main becomes
'frtime-heart.
After setting the cells, complete the connection by clicking the left
mouse button in both animation windows. The player running the server
can reset the score by pressing 'r'.
pizza.ss : A simple "pizza ordering" user interface based on an HtDP
exercise.

View File

@ -230,7 +230,8 @@
(add-signal-controls
(class gauge%
(init value)
(super-new))
(super-new)
(send this set-value value))
(value set-value 0)
(range set-range 1)))

View File

@ -29,3 +29,4 @@ Known Bugs:
- Whole-screen redraw, as when scrolling or resizing, is super slow.
- Errors arising during re-evaluation (not during initial evaluation) go
to the DrScheme interactions window instead of propagating to the cell.
- Does not work on MacOS

View File

@ -41,11 +41,18 @@
; for thread ids, port is the TCP port number (not to be confused with MzScheme ports)
(define-values (listener port)
; find first free port after 1178
(let loop ([port 1178])
(with-handlers
([exn:fail:network? (lambda (_) (loop (add1 port)))])
(values (tcp-listen port) port))))
; for the time being, disable distribution
(values never-evt 1178))
(define (find-listener/port num-retries)
(parameterize ([current-pseudo-random-generator (make-pseudo-random-generator)])
(let loop ([i 0])
(with-handlers* ([(lambda (exn)
(and (exn:fail:network? exn)
(< i num-retries)))
(lambda (_) (loop (add1 i)))])
(let ([port (+ 1024 (random 64000))])
(values (tcp-listen port) port))))))
(define ip-address '127.0.0.1
#;(let*-values