- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I is the timeout parameter where the timer tic starts from when the function called. Logically if there is no data then the API should return timeout.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually the function ALWAYS returns a timeout unless the buffer limit is exceeded. I am using it to wait for a response where I don't know what the length will be. So I allocate a buffer big enough to fit a worst case response. This guarantees that I will always timeout which is a waste of time. If I knew that the timeout was the time since the last character was received, then I could shorten up the timeout parameter which would speed up the transaction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As an experiment I shortened the timeout parameter to one that would be too small given the size of the data packet I am expecting. If the timeout was only from the time of the initial call then the data would be truncated. Happily it was not. I got the entire message meaning that the timeout is re-triggered as each character is received. This is good news because it allows me to set a smaller timeout number than worst case and not suffer a long latency for every message.