when-socket-ready

From: <dtillman_at_cannonexpress.com>
Date: Fri, 15 Jan 1999 10:27:54 -0600

  Would someone like to take a shot at telling me what totally
  obvious thing I am missing that is keeping this from working
  as I expect it to?

  Please note that I have never used the when-socket-ready procedure before.

  Should I be doing some sort of curry thing or maybe a delayed eval in
  my creation of the handler procedures

  -Dave



(define *ports* '(4000 4004 6667 7321 8000))



(define s-handler (lambda (s)
                    (socket-accept-connection s)
                    (format #t "Got Connection on port ~A from ~A!~%"
                            (socket-port s)
                            (socket-host-address s))
                    (shutdown s)))



(define dumbo (lambda ()
                (let* ((sockets (map make-server-socket *ports*))
                       (handlers (map (lambda (s)
                                        (lambda ()
                                          (s-handler s)))
                                      sockets)))
                  (map when-socket-ready sockets handlers))))
Received on Fri Jan 15 1999 - 17:28:03 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST