Lisp HUG Maillist Archive

TCP timeout

Hi,

I'm having some trouble with getting a TCP connection to timeout on 
connect.  My understanding is that the following function should return 
Nil after 3 seconds:

(comm:open-tcp-stream "1.0.0.3" 3999 direction :io :read-timeout 3)

However, the :read-timeout keyword seems to have no effect on how long 
it attempts to connect. For me it takes somewhere around 1 minute 
before it times out. I'm using LWM.

Is this an error, or am I missing something about the specs for this 
function?

Thanks,

-Chris


Re: TCP timeout

On 20 Oct 2004, at 01:40, Chris R. Sims wrote:

> Hi,
>
> I'm having some trouble with getting a TCP connection to timeout on 
> connect.  My understanding is that the following function should 
> return Nil after 3 seconds:
>
> (comm:open-tcp-stream "1.0.0.3" 3999 direction :io :read-timeout 3)
>
> However, the :read-timeout keyword seems to have no effect on how long 
> it attempts to connect. For me it takes somewhere around 1 minute 
> before it times out. I'm using LWM.
>
> Is this an error, or am I missing something about the specs for this 
> function?
>
> Thanks,
>
> -Chris

As far as I understand the documentation, the :read-timeout that you 
specify is only used after the connection is made within the resulting 
stream for read operations. I have not yet tested this in practice 
though. Maybe there should be something like a :connect-timeout as 
well. I can imagine lots of situations where you would want this (to 
increase application reliability, ui responsiveness, etc...)

Sven


Re: TCP timeout

Sven Van Caekenberghe <sven@beta9.be> writes:

> though. Maybe there should be something like a :connect-timeout as
> well. I can imagine lots of situations where you would want this (to
> increase application reliability, ui responsiveness, etc...)

I think the undocumented keyword :timeout that does this, but
maybe someone from Xanalys should comment on if you can use it
safely. Seems to be doing its work for me.
-- 
  (espen)


Re: TCP timeout

Unable to parse email body. Email id is 2924

Updated at: 2020-12-10 08:54 UTC