Dirk,
You shouldn't be modifying the XML data. Rather, you should tranform it
to contain the linebreaks (using something like base64 or something).
Or better yet, why not serialize to a binary format and then encode
using base64? You don't have to worry about linebreaks then.
Why are you removing the linebreaks at all? Is the message you are
sending dependent on linebreaks? If you have dynamic content in your
messages, then you need to have some method of accounting for the fact that
the dynamic content could have linebreaks itself. Modifying the content is
a bad idea, because then you can end up with errors due to the
transformation (plus the fact that you are modifying it is a generally bad
idea). If anything, transform it to a format that doesn't have line breaks,
and send that.
"Dirk Reske" <_F*******@gmx.net> wrote in message
news:O%****************@TK2MSFTNGP11.phx.gbl...
Hey,
I have following struct:
struct Packet
{
string Command;
byte[] data;
}
I want to send this trough an open Network connection.
I serialize it first and remove all linebreaks in the XML data.
When I send it using WriteLine(strXML), what happens with linebreaks in
the bytearray?
Does it only send the content til the linebreak?
thx