How can I send a byte (or bytes) to test a TCP socket that's listening on a port in my application? My application receives a single byte that tells it what to do. Some operations will receive additional bytes to further instruct it.
I tried using Telnet already, but when I input the int value, it seems to send the int (4 bytes).
I just need to send a single byte (8 bits), instead of a sequence of 4 bytes. Is there an easy way to test my socket application? Should I just create another application to test it?
echo -e '\x04' | nc 127.0.0.1 1234
– Diestockecho -e '\x04''\x03' | nc 127.0.0.1 1234
– Diestocktelnet 127.0.0.1 1234
to connect, then pressCtrl+D
to send 0x04 (since D is 0x68). – Diestock