Ah, this reminds me that I forgot to tell this. Yes, that was exactly the case with me, too. Felix, would there be any difference with the let-location patch?
Daishi At Sat, 12 Nov 2005 19:16:15 +0100, David Janssens wrote: > > [1 <multipart/alternative (7bit)>] > [1.1 <text/plain; ISO-8859-1 (quoted-printable)>] > > [1.2 <text/html; ISO-8859-1 (quoted-printable)>] > Hello, > > udp-recvfrom doesnt seem to work under cygwin with chicken v2.2. ("Bad > address" error) > > Replacing udp-recvfrom with this suggested patch doesnt work either: > > (define udp-recvfrom > (lambda (sock len) > (let ((fd (io:descriptor sock)) > (buf (make-string len)) > (from (make-string _sockaddr_in_size))) > (let-location ((fromlen int _sockaddr_in_size)) > (let ((result > (restart-nonblocking "recvfrom" fd #t > (lambda () (##net#recvfrom fd buf len > 0 from # > $fromlen))))) > (values result (substring buf 0 result) > (##net#inaddr->string from) (##net#inaddr-port from)))))) ) > > However, udp-recvfrom seems to work when I replace it with this less portable > version: > > (define udp-recvfrom > (lambda (sock len) > (let ((fd (io:descriptor sock)) > (buf (make-string len)) > (from (make-string _sockaddr_in_size)) > (fromlen (make-string 4))) > (string-set! fromlen 0 (integer->char _sockaddr_in_size)) > (string-set! fromlen 1 (integer->char 0)) > (string-set! fromlen 2 (integer->char 0)) > (string-set! fromlen 3 (integer->char 0)) > (let ((result > (restart-nonblocking "recvfrom" fd #t > (lambda () (##net#recvfrom fd buf len > 0 from > fromlen))))) > (values result (substring buf 0 result) > (##net#inaddr->string from) (##net#inaddr-port from)))))) > > Does anyone have a clue why this is so? > > David > > > [2 <text/plain; us-ascii (7bit)>] > _______________________________________________ > Chicken-users mailing list > Chicken-users@nongnu.org > http://lists.nongnu.org/mailman/listinfo/chicken-users _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users