문제

I have the following problem. I have to send a text telegram over tcp/ip to a host device. Telegram should be terminated using 0x1A (CTRL-Z) character. But when I send it, host told me that there is a wrong symbol in the telegram. When I terminate a telegram with 32 (0x20) everything is ok. I look the transfered data using WireShark and I see that when I send 0x1A it is substituted with 0x16, when I send 32 (0x20) as a terminator it is somehow substituted with 0x1A.

Can you explain it please.

P.S. I am working on windows 7, using c++builder xe2.

Thanks, Vladimir

도움이 되었습니까?

해결책

I have found the point. :) All escape sequences in c++ are octal based. so 032 is 0x1A not 0x20.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top