I'm trying to send 15000 packets using a basic client/server and measure the delays but after so many packets sent it starts going a bit out of sync. The client always reports sending 320bytes but the server starts to recieve 140 and 180 now and again.
The server recieves using:
And the client sends using:
when sd is the socket, the kpcEchoMessage is a message of 320bytes and kEchoMessageLen is the length in bytes of kpcEchoMessage. As well as that:
const int kBufferSize = 1024;
Is declared at the start. I don't usually post looking for help but i'm running out of time for a deadline, i've been looking at this for a fair while now and a month ago i'd never seen any c++ code before.
Thanks for any help.
The server recieves using:
Code:
char acReadBuffer[kBufferSize]; int nReadBytes; do { nReadBytes = recv(sd, acReadBuffer, kBufferSize, 0); if (nReadBytes > 0) { cout << "Received " << nReadBytes << " bytes from client." << endl;
Code:
if (send(sd, kpcEchoMessage, kEchoMessageLen, 0) != SOCKET_ERROR)
const int kBufferSize = 1024;
Is declared at the start. I don't usually post looking for help but i'm running out of time for a deadline, i've been looking at this for a fair while now and a month ago i'd never seen any c++ code before.
Thanks for any help.
Comment