Open
Description
The fd_set
structure on Windows has a trailing array of socket that defaults to size 64, which we override to 1024 https://github.com/apple/swift-corelibs-foundation/blob/06072877b110c4ba5501ddc012830c1072f7198c/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h#L133C1-L133C24 .
Instead of using a large fixed-sized buffer, we can treat the structure as dynamically-sized and reallocate it when it gets full. Winsock functions read the size of the array from the count field in order to support the array to exceed 64 as needed. The only caveat is that we can't use the FD_SET
macro because it has to use the compile-time size.
Metadata
Metadata
Assignees
Labels
No labels