Simple TCP client that reads data from a server and writes it to a file