3 ms·
This reminds me of a bug I was hunting years ago in an obscure web server software written in C that was ported from Unix (Solaris perhaps) to Windows. It imple
by kyberias 12y ago
This reminds me of a bug I was hunting years ago in an obscure web server software written in C that was ported from Unix (Solaris perhaps) to Windows. It implemented connections to backend-systems and databases using sockets. Sometimes we got random file errors out of nowhere on Windows but not on Unix.
Turns out BSD sockets are closed with close() just like file descriptors but winsock requires applications to use closesocket(). The guy that ported this to Windows didn't know this and used close() on sockets leaving them dangling and sometimes closing random files on specific circumstances.