don’t forget to flush()

This is sort of a personal reminder and assistance to anyone else wasting their time on this issue. I was having the problem where my socket was working and communicating as expected on Mac OS, but the socket was not working correctly on Windows systems. While a socket connection will write and read data from a sever correctly on a Mac or Linux system without using flush() on the socket data. On a Windows browser it will only send your first write of data and all subsequent writes will not get sent. This puzzling phenomenon wasted quite a bit of my time, so always flush() after writing data to a socket! Unless you want to waste time trudging through a lot of crap.

Leave a Reply

Your email address will not be published. Required fields are marked *