inaki wrote:I am going to add support to configure the timeout. Retries can be configured too. Configuring these parameters per function seems too much. I think
Your idea of doing it at RCB_Start is okay.
So, our start function would become as follows:
RCB_Start( portNumber, flags, maxTimeout, maxRetries);
On second thought, maybe it's better to pass the two parameters via pointers (ie: by reference not by value) so that the user may be able to change their value later without having to call another RCB_* function.
(this may look unclean but it is C after all and maybe we'll wrap the stuff up in some fancy C++ later to protect users from themselves).
One scenario of chaning the retries/timeout during the course of a program is in case there are interferences and you want to throttle the connection before giving and error message.