Bind non-listener handles too.
This commit is contained in:
parent
21cc52f4b0
commit
9cf91bb231
|
@ -72,10 +72,16 @@
|
|||
[(topic _ (handle-mapping local-addr socket) _)
|
||||
(transition (set-remove active-handles local-addr))]))))
|
||||
|
||||
(define (bind-socket! s local-addr)
|
||||
(cond
|
||||
[(udp-listener? local-addr) (udp-bind! s #f (udp-listener-port local-addr))]
|
||||
[(udp-handle? local-addr) (udp-bind! s #f 0)]
|
||||
[else (void)]))
|
||||
|
||||
;; UdpAddress -> BootK
|
||||
(define ((udp-socket-manager local-addr) self-pid)
|
||||
(define s (udp-open-socket #f #f))
|
||||
(when (udp-listener? local-addr) (udp-bind! s #f (udp-listener-port local-addr)))
|
||||
(bind-socket! s local-addr)
|
||||
(define buffer (make-bytes 65536)) ;; TODO: buffer size control
|
||||
(transition 'socket-is-open
|
||||
;; Offers a handle-mapping on the local network so that the
|
||||
|
|
Loading…
Reference in New Issue