c# - How is.NET's NetworkStream delimiting multiple messages in the same packet? -


So I have been entrusted with the task of creating a tool for our QA department which can read the packet from the wire and Can rejoin correctly (they do not rely on our logs ... long story).

The NCT's TCPLstner and TCP Client Classes are being used to communicate the application I want to communicate. Stopped the packet is not a problem (I'm using). However, adding correctly packet to application level messages is proving to be a bit trickier.

In some packets there is a message ending and the next message begins and they tell me how 'networkstream object' in NTT tells us where an application level message ends and the other starts.

I have been successful in determining whether the TCP header "PSH" (push) flag will be turned on in an application level message in any packet. But I do not know how .NET knows what's inside that packet at the end of the message.

The data of a packet can look like this:

  / & lt; Message & gt; & Lt; Message & gt; System = http: // blah  

from the header only & lt; / Messages & gt; And store until the rest is completed until the rest of the message is complete?

There is no IP level flag set for fragmentation, and there is no knowledge of .NET sockets. Application level protocols, I am incredibly disturbed. Any insights will be appreciated.

The stream does not know the end of something - this should be part of the application protocol.

In the networkstream , nothing is included to convert the data to an object. What do you think of this? Does the network manage the code to use the stream? Are you probably doing some form of XML deserialization, and the read code automatically stops when it reaches the closing tag?

Actually:

  • If your protocol has no message delimiter or length prefix, it should be
  • networkstream There is no possibility of cleverness of yourself - but if you can tell us what you are watching, we may be probably what's happening.

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -