Hacker News new | ask | show | jobs
by diowldxiks 87 days ago
Does this work in the face of state changing out from under the socket? I'm not super familiar with low level socket details but I'm thinking something like connect returning EINPROGRESS and you not knowing if the connection has completed. It may complete, it may fail, but during that time this state machine is invalid I think. It seems like strict logical programming like this gets much harder in the face of mutable state changing out from under the program, but that can probably be worked around with enough effort.
1 comments

You are right, what I wrote is more of a PoC. It's valid for blocking sockets on the happy path.