Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, in a TCP communication where a string is passed from the client to the host this happens:

Sent message by the client:

<open>
<feed1 type="feedbyyou">
<door1 id=""/>
<open/>

Received message by the host:

<open>\n <feed1 type=\"feedbyyou\">\n <door1 id=\"\"/>\n</open>


Why is this happening? The client program is in C++ as well as the host program. Can anyone help me understand?

Thank you.
Nuno
Posted
Comments
Emilio Garavaglia 15-Oct-10 9:36am    
The second text is the same as the first, if seen by a C compiler.
How do you get those texts? From a debugger watch? a text file?

1 solution

what is the issue here. You recieved exactly what is sent.

'\n' is new line char
'\' in the message is used as escape char.
 
Share this answer
 
Comments
Emilio Garavaglia 15-Oct-10 9:13am    
Not sure. To me it seems he's receiving a text that -if processed by a C compiler- will result in the same text.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900