Home All Groups Group Topic Archive Search About

HttpListener idle timeout

Author
12 Dec 2006 2:19 PM
barbutz
Hi,

I'm using the "HttpListenerWebServer" sample from the microsoft 101 samples.
This is basically a simple asynchronous web server based on HttpListener
class.
It works fine exept there is no client idle timeout. Meaning if i open a
connection to the server and keep it idle (not sending any data) the
connection will stay alive forever.
How can i implement a connection idle timeout using the HttpListener class ?

Thanks for your help,
Kfir

Author
13 Dec 2006 10:44 AM
Vadym Stetsyak
Hello, barbutz!

Actually, there is a timeout. You connect to HttpListner server via TCP,
so TCP timeout is present here.

IIRC TCP connection timeout is 2 hours...

How do you connect to HttpListener?

You wrote  on Tue, 12 Dec 2006 06:19:00 -0800:

b> I'm using the "HttpListenerWebServer" sample from the microsoft 101
b> samples. This is basically a simple asynchronous web server based on
b> HttpListener class.
b> It works fine exept there is no client idle timeout. Meaning if i open a
b> connection to the server     and keep it idle (not sending any data) the
b> connection will stay alive forever.
b> How can i implement a connection idle timeout using the HttpListener
b> class ?


With best regards, Vadym Stetsyak.  E-mail: vady***@ukr.net
Author
13 Dec 2006 11:25 AM
barbutz
You are right there is a tcp timeout. But how can i change it if i don't want
the default ? (just like we do in the Socket class read/write timeout)

Show quote
"Vadym Stetsyak" wrote:

> Hello, barbutz!
>
> Actually, there is a timeout. You connect to HttpListner server via TCP,
> so TCP timeout is present here.
>
> IIRC TCP connection timeout is 2 hours...
>
> How do you connect to HttpListener?
>
> You wrote  on Tue, 12 Dec 2006 06:19:00 -0800:
>
>  b> I'm using the "HttpListenerWebServer" sample from the microsoft 101
>  b> samples. This is basically a simple asynchronous web server based on
>  b> HttpListener class.
>  b> It works fine exept there is no client idle timeout. Meaning if i open a
>  b> connection to the server     and keep it idle (not sending any data) the
>  b> connection will stay alive forever.
>  b> How can i implement a connection idle timeout using the HttpListener
>  b> class ?
>
>
> With best regards, Vadym Stetsyak.  E-mail: vady***@ukr.net
>
>
>
Author
13 Dec 2006 3:11 PM
Vadym Stetsyak
Hello, barbutz!

That timeout is stored in the registry. But these settings are global.

OTOH why do you open connection that is not used?
Why can't you open connections on demand?
Every connection allocates resources on the server, so holding them is
not a good thing.

You wrote  on Wed, 13 Dec 2006 03:25:01 -0800:

b> "Vadym Stetsyak" wrote:

??>> Hello, barbutz!
??>>
??>> Actually, there is a timeout. You connect to HttpListner server via
??>> TCP, so TCP timeout is present here. IIRC TCP connection timeout is 2
??>> hours... How do you connect to HttpListener? You wrote  on Tue, 12 Dec
??>> 2006 06:19:00 -0800:
b>>> I'm using the "HttpListenerWebServer" sample from the microsoft 101
b>>> samples. This is basically a simple asynchronous web server based on
b>>> HttpListener class.
b>>> It works fine exept there is no client idle timeout. Meaning if i open
b>>> a connection to the server     and keep it idle (not sending any data)
b>>> the connection will stay alive forever. How can i implement a
b>>> connection idle timeout using the HttpListener class ?
??>>
??>> With best regards, Vadym Stetsyak.  E-mail: vady***@ukr.net
??>>

With best regards, Vadym Stetsyak.  E-mail: vady***@ukr.net

AddThis Social Bookmark Button