// JP opened flex table

Click to See Complete Forum and Search --> : Sending Hex


BageDevimo
December 30th, 2007, 10:59 PM
Hiya,

I was wondering, how can I send hexidecimal chars/codes over Winsock networking?

I need to send: 12 00
Which can not be translated to ASCII.

Thanks!

MikeAThon
December 31st, 2007, 03:30 PM
I don't fully understand your question. Winsock (TCP or UDP) sends bytes, and it doesn't care what those bytes are. It definitely does not "translate". It sends whatever bytes it finds in memory. If you wnat to send hexadecimal, then make certain that the desired hex is in memory, and then send it:
char buffer[]="\x12\x00";
send( s, buffer, sizeof(buffer), 0 );
Mike

BageDevimo
December 31st, 2007, 04:36 PM
Perfect, thanks!

//JP added flex table