FD_SETSIZE for Windows
Gabriel Klyber <[email protected]> Tue, 19 Jan 2016 23:57:56 -0700
| Newsgroups | gmane.comp.web.polipo.user |
|---|---|
| Message-ID | <CAMYhdFvchaZ0C+j8Ark4HfcnF9p_AiuJVpF8+NiT5VPY+vkifQ@mail.gmail.com> |
I have not pinpointed the problem, but I have been experiencing moments where Polipo on Windows will hang. This coincided with many open connections. I disabled gethostbyname thinking it could be the DNS resolver. That did not help. After reading more about using select and FD_ related macros under Windows, I found that select will only handle 64 connections by default. Under Linux, the limit is usually 1024. By defining FD_SETSIZE to 1024 prior to including winsock2.h, this limitation is removed. I added the following in mingw.h: #define FD_SETSIZE 1024 before #include <winsock2.h> This seems to have resolved the issue I had with connections hanging when Polipo had a lot of open connections. This is the biggest improvement I have seen of all the changes I have tried. Thanks, Gabe ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140