On Mon, Apr 17, 2000 at 01:00:28PM -0500, Glenn MacGregor wrote:
> Andi Kleen wrote:
>
> > On Thu, Apr 13, 2000 at 02:55:32PM -0500, Glenn MacGregor wrote:
> > > Hi All,
> > >
> > > Thanks to all for answering my last question, include netinet/in.h
> > > and it worked fine. I thought that would be included by something
> > > else. Thanks.
> > >
> > > I have written a server that sits in a select loop with a timeout of
> > > 10 secs waiting for connections on a socket. I have written a client
> > > that just connects to that socket and writes argv[1] to it and receives
> > > from the server and exits. I put that in a script that calls it over
> > > and over (no sleep). This runs pretty fast. At about 4000 interations
> > > through the loop the server stops responding for some time. I know this
> > > because the client gives a connect error: Resource temporarily
> > > unavailable. Am I doing something wrong here or is it just the kernel
> > > catching up to me.
> >
> > The client runs out of local ports. You can increase the local
> > ports range with the ip_local_ports_range sysctl (e.g.
> > echo "4000 30000" > /proc/sys/net/ipv4/ip_local_port_range )
> > For some cases (not yours that always connects to the same target)
> > the 2.2+ kernel has a bug that causes it to run out of local ports
> > much earlier than it should. This is worked on.
> >
> > -Andi
>
> If I open the connection then close it when I am done I should not run out of
> ports should I? I have the client which waits until the server returns a
> done to make the next connection. So I am not testing how many concurrent
> connections I can handle (though I have to do that as well). when this is
> running and I look at netstat -a I have hundreds of connections to the port
> that my server is listening on. If I do the close correctly I should not see
> this should I? Or does it take some time for the port to actually close?
It takes some time for them to close: 60 seconds in TIME-WAIT state to
catch old packets.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]