Re: Out Of File/Socket Descriptors



"For Winsock on CE, you can only have 256 open sockets at a time per
application."

I apologize. That information is incorrect. A long time ago we had such a
restriction. But now the limit is MAX_DWORD handles. Although each
Layered Service Provider usually gets a handle from that table as well, so
it's more like [MAX_DWORD / # of installed LSPs]. Winsock will currently
search 256 slots for an open handle. Under normal usage, this should not be
a problem. But if your application created [256 / # LSPs] sockets in a
row, left them open, and then opened and closed [MAX_DWORD / # LSPs]
sockets, it would get an WSAEMFILE error from the next socket() call. If
there's not enough memory to allocate the internal socket structure
associated with the handle, it should get a WSAENOBUFS error instead.

That 256 number (the maximum slots searched) is the one defined inside
Winsock. If that turns out to be the problem you're encountering, we may
consider bumping that number higher or making it registry configurable.

Sorry for the confusion,
-Corey

.