Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-05

large TFDSet in windows, select() and FD_XXX() functions - will this work?

3 messages · 1 person · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd

I'm going to experiment with something like this:

https://gist.github.com/2842807

Am I calling for trouble, did I forget something?

According to some Google searching it seems other people have successfully done similar things in their C programs, has anybody here on this list already experimented with such a hack? Did I forget any not so obvious things or would the above definitions already be enough?

Reply by email

Bernd
to Bernd

2012/5/31 Bernd :

I'm going to experiment with something like this: https://gist.github.com/2842807

I just patched my local copy of lNet to use this unit after winsock2 and tried it with Windows XP professional in a virtual machine, I went even higher with the number and it continued working with up to 4096 open connections (server and client on the same machine). The same .exe in wine stopped working somewhere above 1024 connections.

I would like to propose something like this as a patch against winsock2 (simply change the number from 64 to 1024) or at least against lNet to make the TLSelectEventer work the same way on all supported platforms and not unexpectedly and silently(!) fail to detect any events on any other than the 63 newest incoming connections (lNet will silently stop polling the older connections although they are still open and perfectly fine).

Reply by email

Bernd
to Bernd

2012/5/31 Bernd :

I would like to propose something like this as a patch against [...] lNet to make the TLSelectEventer work the same way on all supported platforms

Almindor committed it to trunk :-)

Now we can have non-LCL TCP servers with up to 1023 concurrent connections on windows too. (LCL version uses WSAAsyncSelect() and not select() so for LCL programs this never was a problem but for console apps it was)

Reply by email