|
From: | Jim Ursetto |
Subject: | Re: [Chicken-users] Help with udp6 / socket |
Date: | Mon, 16 Feb 2015 21:17:14 -0600 |
Scott, This works on my system (10.10.2, CHICKEN 4.8.0.6). Note the undocumented argument to udp-open-socket… not sure what I was thinking. If this works for you, I will document the argument and add the example to the wiki. (use udp6) (define s (udp-open-socket 'inet6)) (udp-bind! s "::" 1337) ;; unspecified address; accept both ipv4 and ipv6 (let loop () (receive (len str host port) (udp-recvfrom s 1024) (print "received " len " bytes from [" host "]:" port " : " str)) (loop)) (udp-close-socket s) ;; Then we can run netcats using IPv4 and IPv6: $ nc -6 -u localhost 1337 hello ^C $ nc -4 -u localhost 1337 hi ^C ;; And you should get the following output: received 6 bytes from [::1]:62028 : hello received 3 bytes from [::ffff:127.0.0.1]:61031 : hi
|
[Prev in Thread] | Current Thread | [Next in Thread] |