You can use netcat or nc as a debugging TCP tool. It can be a TCP sender and receiver with a short session (auto close when connection is closed)

Examples :

Scan ports

$ nc -zv 20-80

Check redis status

$ echo 'info' | nc 6379

Retrieve http response

$ printf "GET /xinchao HTTP/1.1\r\n\r\n" | nc 8000 | tee xinchao.txt

Change to IPv6 : nc -6

Want more ??

$ nc -h