mirror of
https://github.com/php-win-ext/grpc.git
synced 2026-03-28 11:02:07 +01:00
A closer reading of the API for getsockopt revealed that we were depending on an implementation detail of getsockopt on Linux. This assumption breaks down on MacOS. getsockopt merely guarantees that it will return on 0 in case of failure and a value greater than 0 in case of success. There is no guarantee as to *which* non-zero value you will receive. On Linux, it seems to be 1, the value which was explicitly set. On MacOS, it seems to be the value of the FLAG which was set, i.e. 512 for SO_REUSEPORT. This commit ensures the check we use does not rely on either of these implementation details.