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

.



Relevant Pages

  • File Descriptors With High Values
    ... running out of file descriptors. ... "-1" checks and I'm nearly positive that all open sockets are being ... most of the sockets are valued over 100 and on runs where it ...
    (comp.unix.programmer)
  • Re: How to synchronize apps running?
    ... application connects to those sockets, ... start and open sockets, the second one runs, tries to connect, fails ... sources of the first application and the "master" one. ... some ideas on a nice way how master application can delay execution of ...
    (comp.lang.java.programmer)
  • Re: SocketServer design
    ... You can have more then 64 open sockets. ... server that uses this method is the open source Cassini Web server by MS. ... queue connections and handle them via the queue. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: OT: load distribution algorithm
    ... I have a thread accepting socket connections from remote users. ... Sockets will be randomly closed by users, so the load of open sockets ...
    (comp.lang.tcl)
  • Re: Out Of File/Socket Descriptors
    ... For Winsock on CE, you can only have 256 open sockets at a time per ... Prev by Date: ...
    (microsoft.public.windowsce.app.development)