This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem when lots of sockets open.


On Mon, Mar 12, 2001 at 01:27:03PM -0700, Gary Thomas wrote:

> >> FYI: I've built a stripped down app that successfully accepts
> >> connections on 16 TCP ports simultaneously, so it appears to be
> >> an application bug.
> > 
> > I can duplicate the failure in my stripped down demo
> > application: If there's a single task that uses select to
> > monitor the listening sockets and the echo data on the
> > connected data sockets, it works fine.
> > 
> > If I create separate tasks to echo data on each connected
> > socket, the 9th connection fails. A read() on the socket
> > returns -1 immediately with errno==360 (operation timed out).
> > 
> > Has anybody seen behavior like this?
> 
> No.  Can you provide the test case?

I just figured out the problem. 

CYGPKG_NET_NUM_WAKEUP_EVENTS controls the max number of pending
(blocked) network operations, and it defaults to 8.  

When you try to perform the 9th blocking operation, you run out
of wakup events and you get an ETIMEDOUT error.  Despite my
earlier claim that I wasn't closing the sockets, it was my task
that was closing the socket when it got the error return from
read().

Once I figured out I was getting a ETIMEDOUT error, it was
pretty easy to grep through the net sources and find what was
causing it.

-- 
Grant Edwards
grante@visi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]