[Top][All Lists]
[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: |
Alexsandro Soares |
Subject: |
Re: [Chicken-users] How to convert an UDP socket to file descriptor |
Date: |
Thu, 29 Apr 2010 08:47:29 -0300 |
Hi Peter,
I changed the line
(fd (port->fileno (udp-bound-port s)))
to
(fd (port->fileno port))
But now, the error is
Error: (port->fileno) argument is not a port: 6000
Any help?
Alex
2010/4/29 Peter Bex <address@hidden>:
> 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
>