- Jul 13, 2001
- 258
- 0
- 0
Suppose you are using java sockets to send data via TCP to a remote host. If you call the send() method multiple times, TCP will aggregate your messages into a single packet. My question is this: If you send a short message (much less than MTU) using send(), are there any circumstances in which a single reveive() on the remote host will not receive the entire message (assuming the receive buffer is of adequate size)?
e.g.
host1
send("hello there")
host2
1st receive() = "hello "
2nd receive() = "there"
I've never seen this occur in practice, but it seems like it could occur if the first part of the message fills up a packet that has been aggregating data from the last few sends, so the end of the message has to be sent in a new packet.
Thanks
e.g.
host1
send("hello there")
host2
1st receive() = "hello "
2nd receive() = "there"
I've never seen this occur in practice, but it seems like it could occur if the first part of the message fills up a packet that has been aggregating data from the last few sends, so the end of the message has to be sent in a new packet.
Thanks