05-10-2016 02:25 PM
It always takes between 513 - 525 milliseconds to read a message, regardless if the message data has 32 bytes or 4K bytes.
Here is the call:
readSize = ServerTCPRead(handle, (char *)&msgBuf[0], 4096, 1000);
Is there a safe way to fix this issue? My downloads are taking forever because of the read times.
Could I safely reduce the timeout time to get better performance?
FYI the data writes work fine - only take 12 - 30 milliseconds:
bytesOut = ServerTCPWrite (handle, &msg, (lwMsgSize*4), 1000);
05-10-2016 05:20 PM
Actually I had a bug in my code. The read delay is more like 75-100 milliseconds.
That is still a lot when reading a response, which is required before sending the next download message
05-30-2016 06:54 AM
Hello Butch01
Try call the read func twice
in the first call with max size = 0 than the func will return the byte count ready in the buffer
in the second call it with the size returned in the 1st call