Worked around lack of timeouts in fwrite(), using non-blocking I/O. Also flush the...