chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] tcp-read-timeout: procedure or parameter?


From: felix winkelmann
Subject: Re: [Chicken-users] tcp-read-timeout: procedure or parameter?
Date: Tue, 24 Jun 2008 08:26:00 +0200

On Tue, Jun 24, 2008 at 7:44 AM, William Xu <address@hidden> wrote:
> The wiki says it's a parameter:
>
> ,----
> | http://chicken.wiki.br/Unit%20tcp#tcp-read-timeout
> |
> | tcp-read-timeout
> |
> | [parameter] tcp-read-timeout
> |
> | Determines the timeout for TCP read operations in milliseconds. A
> | timeout of #f disables timeout checking. The default read timeout is
> | 60000, i.e. 1 minute.
> `----
>
> In csi, it's actually a procedure:
>
> ,----
> | #;1> (use tcp)
> | ; loading library tcp ...
> | #;2> tcp-read-timeout
> | #<procedure (f_8338 . arg1040)>
> | #;3>
> `----
>
> So what's the correct way of disabling read timeout? Like this?
>

A parameter is a special kind of procedure. You access it like this:

(tcp-read-timeout) -> <timeout-value>
(tcp-read-timeout <new-value>)

>
> What I'm trying to do is, in a tcp connection: I'd like to pass some
> socket options like keep-alive, so as to make the client says connected.
> Any ideas?

There is now API for that, yet. But see the function ##sys#bind-socket in
tcp.scm for an example of the use of socket options. I guess we have to
add support for this.


cheers,
felix




reply via email to

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