If you're using a unix-like system with a bash shell and you have
netcat installed, you could do this:
echo "ADDMESSAGE test hello world" | nc 127.0.0.1 4671
But there's almost certainly a socket implementation in whatever
programming environment your application is written in, and you should
probably use that in preference to running commands on the shell.
Andrew