This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: httpd web server question. Thanks a lot.
- From: "QiangHuang" <jameshq at liverpool dot ac dot uk>
- To: "Andrew Lunn" <andrew dot lunn at ascom dot ch>
- Cc: "Ecos-Discuss" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 16 Jul 2003 17:24:56 +0100
- Subject: RE: [ECOS] httpd web server question. Thanks a lot.
Thanks a lot Andrew. But what do u mean for the port reusage? but the http
server socket is created at the beginning and port default to 80 and never
get closed. so what should I do with this? is the setsockopt() to be used on
the client socket? or? could you give me a little detail thanks a lot.
-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Andrew Lunn
Sent: 16 July 2003 17:15
To: QiangHuang
Cc: Ecos-Discuss
Subject: Re: [ECOS] httpd web server question. Thanks a lot.
On Wed, Jul 16, 2003 at 05:02:32PM +0100, QiangHuang wrote:
> Hi all:
> I am using httpd web server, but I encounter a problem as:
> in ecos configuation when set "max number of open sockets = 16" then the
> web browser request the web page without problem in the first 15 times and
> when approaching the 16 times the browser will delay for a longer periode
> and sometime will just can't find the web page but after that when rehit
the
> refresh it works fine for the next 15 accessing, but whenever comes to the
> every 16 times that happens again. seems the client socket which has been
> used not closed properly so I tried to put a "close(client_socket)" after
> "cyg_httpd_process()" in httpd.c but it doesn't work out the problem. Does
> anyone have any idea about this? Thanks a lot.
The code looks like it has a missing close, but thats because the fd
is associated to a stream using fdopen and the stream is closed so
closing the fd. So there is no need to call close.
At a guess i'd say its to do with socket/port reuse. By default a port
cannot be imeadiately reused. This is done to stop old packets from a
previous connection getting into the middle of a new connection on the
same port. Maybe the socket descriptor is being kept until the reuse
timeout has happened. There is a setsockopt which can be called to
turn this off and allow ports to be re-used imeadiately. This might
solve your problem.
I might be guessing totally wrong as well.....
Andrew
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss