<div dir="ltr">It works for me because I have multiple threads, but when I use only one thread per pool (<span style="font-size:12.8px">defaultPoolThreads(1)</span>), it obviosly blocks, which is correct behavior</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 16, 2017 at 7:20 PM, Daniel Kozak <span dir="ltr"><<a href="mailto:kozzi11@gmail.com" target="_blank">kozzi11@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hmm works ok for me. What OS? </div><div class="gmail_extra"><br><div class="gmail_quote">Dne 16. 11. 2017 12:05 dop. napsal uživatel "kdevel via Digitalmars-d-learn" <<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@<wbr>puremagic.com</a>>:<div><div class="h5"><br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wednesday, 15 November 2017 at 13:31:46 UTC, Daniel Kozak wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This one works ok for me, but I am on linux: <a href="https://dpaste.dzfl.pl/f54decee45bc" rel="noreferrer" target="_blank">https://dpaste.dzfl.pl/f54dece<wbr>e45bc</a><br>
</blockquote>
<br>
It works, but it does not handle two connects in parallel. STR:<br>
<br>
1. start the binary in console 1<br>
2. telnet localhost 4444 in console 2<br>
3. telnet localhost 4444 in console 3<br>
4. enter a [RETURN] in console (3)<br>
<br>
observed: nothing (the "thread" handling the first connect blocks)<br>
expected: response<br>
<br>
On my machine defaultPoolThreads() returns 1. This can easily be increased:<br>
<br>
```<br>
   defaultPoolThreads(8);<br>
```<br>
<br>
There is also another problem with Socket.select: It may return -1. This frequently happens when the ACCEPT socket is non-blocking and the select is interrupted (by the GC?) then errno == EINTR.<br>
<br>
Also not having a timeout in the Socket.select of handle_socket allows for DOS attacks like the one above. In case of a timeout select also returns -1.<br>
</blockquote></div></div></div></div>
</blockquote></div><br></div>