You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Providing a more fair servicing of multiple tcp clients.
I modified `EthernetServer::available()` such that it will not always pick the
socket with the lowest number that has data available. Instead when the method
returned the client at socket i, it will check socket (i+1) % MAX_SOCK_NUM first
when then method is called the next time.
The problem with the previous implementation is that if there is a client
connected to a socket with a low number (e.g. the first one with number 0) and the
peer constantly sends data. In that case `EthernetServer::available()` always
returns that client. The clients, which are connected to a socket with a higher
number (e.g. 1, 2, or 3), can only be returned when the ones with lower numbers
have no data available.
This problem is fixed with this commit.
This commit also implements the changes suggested by @matthijskooijman.
0 commit comments