TCP - send and receive TCP / IP data

I have a client and server that communicate with each other using the TCP connection standard.

The server is configured to send data in blocks of x bytes in size. The client is also configured to receive data in chunks of x bytes (that is, the client expects that the TCP stack call to receive x bytes will succeed if the connection to the remote end did not end).

Can my TCP protocol be based on the assumption above?

+4
source share
2 answers

Deja vu Will read TCPStream until all data has been received.

I understand that this looks a little different, but at the heart they are very similar questions.

Do not make assumptions about packet sizes.

+3
source

No. TCP is a flow based protocol. You cannot guarantee "chunks" unless you process yourself at the application level. TCP as a protocol does not guarantee this for you.

+3
source

All Articles