Transfering files seems to work over TCP

Need UDP to work now and to make the writing of files work with
latency/dropped packets etc.