Performance increase: Send size and actual packet at once. This causes about 40% less total packets to be sent.
This commit is contained in:
@@ -273,7 +273,7 @@ int EzSockets::PeekData(char *data, unsigned int bytes)
|
||||
void EzSockets::SendPack(const char *data, unsigned int bytes)
|
||||
{
|
||||
unsigned int SendSize = htonl(bytes);
|
||||
SendData((const char *)&SendSize, sizeof(int));
|
||||
outBuffer.append( (const char *) & SendSize, 4); //Add size to buffer, but don't send yet.
|
||||
SendData(data, bytes);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user