Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Client socket - Sending hex but see ascii code on wire

Status
Not open for further replies.

simoco

Programmer
Feb 10, 2011
6
GB
Hi

I'm trying to send a hex stream on a client socket and despite converting the ouput to hex it still appears on the wire as the ascii code of the character that is sent.

I.e. I send 0005 and from wireshark I see 30 30 30 35 - What I need is 00 05

I have done a 'format %x $var' to conver to hex but I think I will need to set some parameter on the client socket to stop it converting to ascii.

Does anyone know how to 'fconfiure' the socket to get my required result.

Thanks
 
The socket needs to be configured for binary:
fconfigure <channelID> -translation binary
But you can just send the character representation of the binary:
\x00 \x05

_________________
Bob Rashkin
 
Thats got it - Thanks a load (I'll sleep better now this weekend).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top