If this is the case, then why does it work on some connections? Also, I am fairly certain that it is dying early because I run Windows under VMware, so I can look at the output of both at the same time. When socat creates an empty file instead of a Word document, it ends during the server output about opening and writing the temporary files. Either case, the same output is printed on the console. Anyway, I just tried adding binmod($client) to the top of the while loop; worked twice, empty file twice. Thanks anyway.