Darwin / macOS (at least Darwin 22.6.0 / macOS Ventura 13.5.2) can return an ENOTCONN error to a zero-byte write after a poll() after a connect() indicates that the connection is ready for writing.
In this case repeating the check allows the non-blocking I/O operation to continue and work as expected
Darwin / macOS (at least Darwin 22.6.0 / macOS Ventura 13.5.2) can return an
ENOTCONN
error to a zero-byte write after apoll()
after aconnect()
indicates that the connection is ready for writing.In this case repeating the check allows the non-blocking I/O operation to continue and work as expected