Difficulties with uniqueness of socket handles

Discussion on this typical problem that happens when building out socket libraries:

This is subtle yet important problem to solve in a socket library.