On 11/2/2026 6:42 PM, Charlie Gibbs wrote:
> On 2026-11-02, Chris M. Thomasson <chri…@gmail.com> wrote:
>
>> On 11/1/2026 11:40 AM, Charlie Gibbs wrote:
>>
>>> I was already setting the socket to non-blocking before calling
>>> connect() - and yet there were times when the API blocked anyway.
>>> I never did figure out why, and we had a customer getting impatient,
>>> so I just spun off another thread and moved on to other things.
>>
>> connect? On Windows we use ConnectEx.
>>
>> https://learn.microsoft.com/en-us/windows/win32/api/mswsock/nc-mswsock-lpfn_connectex
>>
>> For accept, AcceptEx:
>>
>> https://learn.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-acceptex
>
> Ah, but then we come to that critical clause:
>
> Note This function is a Microsoft-specific extension to the Windows Sockets specification.
>
> Yes, one more attempt to close the open socket model with
> Microsoft proprietary extensions. My code has to run under
> Linux as well. Opening the socket in a separate thread is
> guaranteed to avoid hangs, regardless of operating system.
>
These are for high performance systems. But, they solve a lot of problems. Say your program starts to gain a lot of users?