On the receiving end running,
nc -l -p 1234 > out.file
On the sending end running,
nc -w 3 [destination] 1234 < out.file
On the receiving end running,
nc -l -p 1234 > out.file
On the sending end running,
nc -w 3 [destination] 1234 < out.file