I have clients sending a request of a very simple form: just the string GET/PUT/INSERT/DELETE KEY <VALUE> where value is optional depending on the selected keyword.
Keys and values can be arbitrarily sized.
I am implementing a server in C to service the requests however I think I am running into the issue that the read() system call reads some, but not all data. That is, what the server read is only a subset of what the client sent.
How can I know when the entire message has been read?
Example Requests:
INSERT KEYkeyKEYkeyKEY VALUEvalueVALUEvalueVALUE
But the Server Might Read:
INSERT KEYkeyKEYkeyKEY VALUEvalueVALUE
How can I know the entire message has not yet been received and read?