The last: I asked for a quick TCP server in C++ that handled just a single client (disconnecting the existing client when a new client connected), with a send() that I could call from another thread. It was holding mutexes over read(), and trying to set the SO_REUSEPORT port socket option on a socket that had already been bound. Subtley broken garbage.
It would literally be better to copy and paste a solution off Stack Overflow, because at least there's a chance it'd have been reviewed by someone who knows what they're doing.