I am trying to send messages over tcp/ip between two servers.
I want to send a message that is 30KB.
But I want to send it with as a whole.
I don’t want tcp protocol to break it into segments.
I am using communication between 2 Windows Server 2008 R2.
The client and the server are coded using c#.
I tryed using
tcpclnt.SendBufferSize = 100000;
tcpclnt.Client.DontFragment = true;
and the same at the server.
I also tried configuring the window size of the server(editing the registry).
Altering buffersize will have the sideeffect of ramping up ram usage – not recommended…
As TCP actually deals with streams and not packets (UDP uses packets), I believe your answer lies within framing the message, see message framing
see also code
Found this possible solution somewhat later but thought it should be included here:
SetTcpWindowSize
Search towards the bottom for a VB example entitled “Setting the TCP Window Size for All Network Adapters”
Alternatively there is a buffer handler here which looks like it will do the job of allowing you to read a message in one part even if it is in multiple packets it will allow you to reassemble them via buffer management. See this link