chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] How to convert an UDP socket to file descriptor


From: Peter Bex
Subject: Re: [Chicken-users] How to convert an UDP socket to file descriptor
Date: Thu, 29 Apr 2010 09:09:05 +0200
User-agent: Mutt/1.4.2.3i

On Thu, Apr 29, 2010 at 12:20:18AM -0300, Alexsandro Soares wrote:
> Hello,
> 
>     I'm new in Chicken and I'm trying to write a small UDP client
> using file-select. But i get the following error:
> 
>            Error: (port->fileno) argument is not a port: 45691

I think you confused Scheme's concept of ports with the OS concept of
ports on network interfaces.  udp-bound-port doesn't return a Scheme
port!  Instead, it returns the network port number it's bound to.

I think you can just change it to (port->fileno port), where port
is the cadr of SP.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth




reply via email to

[Prev in Thread] Current Thread [Next in Thread]