My application has multiple opened sockets. Should I call tcp_tick(&socket_n) for each of them or can I just use tcp_tick(NULL) periodically?
Thank you,
My application has multiple opened sockets. Should I call tcp_tick(&socket_n) for each of them or can I just use tcp_tick(NULL) periodically?
Thank you,
My preference is to call tcp_tick(NULL) unless there is a particular reason to give priority to a socket or sockets.
In our data loggers we use uCosII and have a separate task just for the tcp_tick() code so that we don’t have to pepper the code with calls to tcp_tick(). This works quite well and you can tune the network performance by adjusting the task priority and also calling tcp_tick() more than once each time the task runs.
Regards,
Peter
At least in Dynamic C 10, processing is identical regardless of what you pass. Whenever you call tcp_tick(), it processes received packets and manages all sockets. If you’ve passed a non-NULL value, tcp_tick() will return the result of calling sock_alive() for the socket you pass in.
If you’re ignoring the return value of tcp_tick(), there isn’t any reason to pass a non-NULL value.