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