- Joined
- Oct 31, 2008
- Messages
- 341
- Reaction score
- 294
Hello, is there any way to make the Buffer for Recv Dynamic ?
this is the way I actually use it ..
this is the way I actually use it ..
PHP:
bool CClient::ClientThread()
{
std::vector<char> szBuffer(65535);
int iReceivedBytes;
do
{
iReceivedBytes = recv(this->ClientSocket, szBuffer.data(), szBuffer.size(), 0);
if (iReceivedBytes <= 0)
{
closesocket(this->ClientSocket);
return 0;
}
this->PacketControl( szBuffer.data() );
} while (this->ClientSocket != INVALID_SOCKET);
return 0;
}