Using pseudo C# simply because it's what I'm using, and assuming C# simply wraps TCP protocol:
A
Socket s = ...; //a valid open socket that is receiving
string str = "abcdefghijklmnopqrstuvwxyz";
for(int i=0; i<10;++i)
{
byte[] buf = ASCII.GetBytes(str);
s.Send(buf)
}
B
Socket s = ...; //a valid open socket that is receiving
string str = "abcdefghijklmnopqrstuvwxyz";
string str2 = "";
for(int i=0; i<10;++i)
{
str2 += str;
}
byte[] buf = ASCII.GetBytes(str2);
s.Send(buf)
How are these actually different at TCP level, and specifically will the receiver have any way to know the first was 10 separate messages and the second a single message? Does TCP treat each send call as having some packet or end-identifier, or is it simply pushing bytes into a stream and I must define a way to determine what was sent based on the content itself?