When we send a large amount of data to the client,its ReceiveAsync event is being called more than one time and in each time we get a few piece of the packet.
What shall we do to get C# Silverlight Tcp Packet in one piece and through one event?
Thank you in advance.
When we send a large amount of data to the client,its ReceiveAsync event is
Share
You can’t. The very nature of TCP is that data gets broken up into packets. Keep receiving data until you’ve got the whole message (whatever that will be). Some options for this:
I generally dislike the final option, as it means “understanding” the message as you’re reading it, which can be tricky – and may mean you need to add escape sequences etc if your delimiter can naturally occur within the message.