more Rackety, useless exn msg

This commit is contained in:
Matthias Felleisen 2014-09-30 09:31:24 -04:00
parent 98e9bc7f9c
commit 549776eaad

View File

@ -170,23 +170,18 @@
(define tcp-listener
(with-handlers ((exn:fail:network? (lambda (x) (stop! x))))
(tcp-listen port 4 #t)))
;; (list IPort OPort) -> Void
;; [list IPort OPort] -> Void
(define (add-iworld in-out)
(define in (first in-out))
(define out (second in-out))
;; is it possible to kill the server with lots of bad connections?
(with-handlers ((tcp-eof? (lambda _ (void)))
(exn? (lambda (e)
(printf "process registration failed!\n~a"
(exn-message e)))))
(tcp-process-registration
in out (lambda (info) (pnew (create-iworld in out info))))))
(exn? (lambda (e) (printf "process registration failed!\n"))))
(tcp-process-registration in out (lambda (info) (pnew (create-iworld in out info))))))
;; IWorld -> [IPort -> Void]
(define (process-message p)
(lambda (in)
(define (disc e)
(pdisconnect p))
(with-handlers ((tcp-eof? disc))
(with-handlers ((tcp-eof? (lambda (e) (pdisconnect p))))
(pmsg p (tcp-receive in)))))
;; --- go universe go ---
(set! iworlds '())