-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket limit for Select on Linux (memory corruption) #445
Comments
… the socket descriptor to FD_SETSIZE instead of comparing the list count to FD_SETSIZE.
Is this working now? |
This is not enough for my purposes (WEB Server). I have a lot more than 1024 connections. In my version, I use |
Per machine? Then how are you not running into file descriptor limitations outside of In any case, internally Indy uses only 1-2 sockets per |
Does the problem also exist in the Indy version that comes with Delphi 11? We also use Indy as a web server under Linux. |
Yes, it does. And Embarcadero is already beta testing the next RAD Studio release, so a fix for this issue will likely not make it into that release, either. Maybe the release after that... |
Per process. Limit for file descriptors can be increased by 'ulimit' Note. Each outgoing connection also occupies one handle. If process made 1024 outgoing connection - first incoming connection got Handle=1025 and can't be |
That's good news. However, a new release of Embarcadero may take quite a while before it is released. |
Sorry for the delay in responding.
Actually, yes, I believe so. You should be able to derive a new class from
And then, at runtime you can assign your new class type to Indy's global
The default platform-specific |
Thank you very much! We will try that and let you know if it worked. |
@rlebeau I tried to implement the workaround you suggest using your code above. However I run into several problems and can not compile it. Another problem is that I don't have Am I missing something? Appreciate any help. |
I wrote that example from scratch off the top of my head, I didn't actually test it. I did say to "feel free to adjust this code as needed", which would include tweaking it to make it compile :-)
The non-generic
Obviously, you will need to add the appropriate declaring unit in your |
How is this looking? Were you able to get it working? |
We were looking for another solution so far, however we try to get it working using your approach in the next days. We'll keep you posted. |
I finally was able to get it working using your code and it works good so far. I also created a PR #473 |
TIdSocketListVCLPosix.Add checks Count < FD_SETSIZE. It is incorrect in Posix. Need to check: AHandle < FD_SETSIZE.
_FD_SET causes memory corruption if AHandle > 1024.
It is advisable to replace
select
topoll
in LinuxThe text was updated successfully, but these errors were encountered: