-
Notifications
You must be signed in to change notification settings - Fork 212
Non-blocking TCP connect; some edits for Arduino 1.5; a fix for duplicate packet spam #15
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
Conversation
…cate packet spam Added non-blocking TCP connect, with example code Some edits for Arduino IDE 1.5 A fix for duplicate packet spam (needs a better fix, setting the timer thing too low brings back the spam)
Thank you for contributing! |
regarding 'Ultimately we need to figure out why it's sending the same packet multiple times and fix that.': Did you see retransmitted packages after they were acknowledged? |
To become non-blocking connect() requires a 3rd parameter set to true, without that 3rd parameter it defaults to blocking so it still maintains full compatibility with the stock Ethernet. |
I already check out the options. Either 1 additional timer per connection that expires maybe 50ms after packet and then calls uip_process(UIP_POLL_REQUEST) instead of uip_process(UIP_TIMER), or just 1 timer for all connetions (just that is triggers more often than the shared timer being used now). Then the retransmit-timer-interval can be set to 1 sec (defaulting to 3 Sec. initial retransmit time). |
While I'd like to have missing features in UIPEthernet I also want to stay compatible with the stock Ethernet-lib in both ways. Did you propose these API-changes to the Arduino-team too? They are here on github too: https://github.com/arduino/Arduino/tree/master/libraries/Ethernet |
Hmm, it seems work has already been done to the Ethernet library for non-blocking connect and a few other things like DHCP and DNS. This pull request (arduino/Arduino#1240) took me to (https://github.com/arduino/Arduino/tree/2ac4e2f3bdf29e8e7bc4d4274ca03465b0b24d31/libraries/Ethernet). |
Yes, I've seen this, maybe you can try pushing it a bit since it's not yet merged? |
maybe you take the code from the pull-request and do some polishing... Do the same with your current pull-request and make sure this one and the one against Arduino implement the same API, then resubmit against my new branch https://github.com/ntruchsess/arduino_uip/tree/experimental |
I've added non-blocking TCP connect to class UIPClientExt ecbdc65 |
Added non-blocking TCP connect, with example code
Some edits for Arduino IDE 1.5
A fix for duplicate packet spam (needs a better fix, setting the timer
thing too low brings back the spam):
Changed uip_timer_reset() to uip_timer_restart(). When using uip_timer_reset() and if its been a while (say, 5 seconds) since the last call to UIPEthernet::tick() then uip_timer_expired() will return true for its next 20 calls since uip_timer_reset() only adds to the timer whatever the timer interval is set to. Setting the interval to 250 also seems a bit high, the minimum latency achievable with that setting is ~500ms. Ultimately we need to figure out why it's sending the same packet multiple times and fix that.