I'm trying to read a message (string/text) from the server, and I set the buffer size really large (buffer_size = 1000) so that I only need to read once from the server.
So my question is if the message is exactly 10 bytes, and I call read(socket, buffer, buffer_size), then is it gonna read only 10 bytes, since it is less than the actual buffer size? I guess I'm just curious about the behavior of the call in case what is read is actually not as much as what is expected.
Also if I call the read() again, will it overwrite what is in the buffer? (by that I mean empty the buffer and overwrite it with new input)
Thanks in advance