I wrote client-server applicaion communicating via socket. I met a big problem that I did not know which function can be use to indicate the buffer size will be received before calling function recv() or WSARecv().
I want to know this information to allocate the buffer enough to receive the message coming.
/*Do which thing here to indicate buffer size bufSize = ???*/
char*buffer = new char[bufSize];
If we dont know this information before calling receiving function, the problem is we won't know how big the buffer size should is.
Although, we can do: char buffer; but the size of coming message can be bigger or the coming message is too smaller than that.
Any boddy know this problem, Can you help me?
Thanks very much & best regards,