How to transfer data using nc command

Today, I learn about how to use nc (netcat) command to transfer data between two servers. Now I want to record the process.

In server A which you want to receive data:

1
nc -l -p 5555 > test.file # 5555 is the port you want to use

In server B which you want to send data:

1
nc server_A_ip_or_domain 5555 < test.file