arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
261 stars 264 forks source link

Providing a more fair servicing of multiple clients by not picking lowest numbered socket in available() #33

Closed agdl closed 8 years ago

agdl commented 8 years ago

From @sauerburger on January 21, 2016 18:5

I modified EthernetServer::available() such that it will not always pick the lowest numbered socket by introducing an internal index int _sock which is incremented by one every time available() is called. (I suppose the previous comment XXX: don't always pick the lowest numbered socket. was to be understood as a TODO)

Copied from original issue: arduino/Arduino/pull/4463

agdl commented 8 years ago

From @matthijskooijman on January 21, 2016 18:11

This change looks useful to me. AFAIU, it allows for a more fair servicing of multiple connections right? Perhaps the commit message could expand on this a bit more.

agdl commented 8 years ago

From @matthijskooijman on January 21, 2016 19:29

Your new commit looks good to me, I think the code is fine as it is. Your new commit message is also very good (except for a few spelling errors :-p)

Could you perhaps merge both commits into a single commit? That would lead to clearer history if this is merged.

agdl commented 8 years ago

From @sauerburger on January 22, 2016 10:38

Ok. Well I have a few git related problems with that: I merged the commits with git rebase, but as I expected I could not push them, so I pushed them to a new branch. Do you know if I can change the source branch of this merge request? If thats impossible should I create a new merge request?

agdl commented 8 years ago

From @matthijskooijman on January 22, 2016 10:47

You can use git push -f to force push and overwrite the existing branch. Github will then update the commits in this PR automatically.

agdl commented 8 years ago

From @sauerburger on January 22, 2016 11:19

ok thanks.