-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update API documentation of transport send/recv functions #136
Conversation
b21ecf0
to
99426ba
Compare
update lexicon for spell check more spelling fixes
* MY_SOCKET_TIMEOUT ); | ||
* if( bytesReceived < 0 ) | ||
* { | ||
* // Handle socket error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here if bytesReceived contains an error code that just means the TCP read timed (or would block) then that is not an error so bytesReceived needs to be translated into whatever the calling function will interpret as "try again" - which for our code is zero, but if this function is calling the TCP read function and passing a value back to the TLS stack then zero may also be interpreted as an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated the pseudo code block to add a check for a retriable error.
* // so that caller can retry operation. | ||
* if( bytesSent == TCP_BUFFER_FULL ) | ||
* { | ||
* bytesSent = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment as per the receive - when the error is not really an error, rather just a full buffer, the error has to be translated into whatever the calling function interprets as meaning 'try again' until you time out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the zero return value represents that the operation can be re-tried.
…n about converting retryable error to zero
…13/coreMQTT into doc/update-transport-recv
Update API of the transport interface functions for the following: