Linux TCP Request Response

# nvim linux-tcp-request-response.sh
#!/bin/sh

HOST=127.0.0.1
PORT=30010
DATA="hello"

exec 3<>/dev/tcp/${HOST}/${PORT}
printf "${DATA}\x$(printf %x 255)" 1>&3
response=$(cat <&3 | head -c -1)

echo "Target  : tcp://${HOST}:${PORT}"
echo ""
echo "Sending : ${DATA}"
echo ""
echo "Receive : ${response}"
# sh linux-tcp-request-response.sh