Skip to content

Fixes to UDP so that it no longer has socket 0 hardcoded - all part of issue #436 #16

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

Merged
3 commits merged into from
Jan 5, 2011

Conversation

amcewen
Copy link
Contributor

@amcewen amcewen commented Dec 28, 2010

UdpClass::begin now finds the first available free socket, or fails if they're all in use.
UdpClass::stop added to release the socket once it is no longer needed.
The global Udp object has also been removed and the examples updated to provide their own instance.
Finally, in testing I noticed that the UdpNtpClient didn't print leading 0s if the minute or second was a single-digit, so have taken the opportunity to provide a simple fix for it.

…te read). This one moves all of the checking into recv, so that single-byte reads also benefit. It also returns -1 if there's no data available unless we've reached EOF, in which case it returns 0.
…e the corrent return values. This should have been in the previous commit, but I'm still getting my head round git.
@damellis
Copy link
Contributor

damellis commented Jan 4, 2011

On a quick review, these changes look reasonable. I'll take a closer look and apply them when I get a chance.

BTW, it's helpful to have separate pull requests for different issues (e.g. UDP changes vs. addition of read(buf, len)). I wouldn't necessarily worry about it here, but it will make things easier going forward. I think it requires the use of separate branches, which is a bit annoying, but luckily git makes it easy to merge changes between them.

@amcewen
Copy link
Contributor Author

amcewen commented Jan 4, 2011

Agreed. I wanted to push them through as separate pull requests, but couldn't work out how to have github do that. Will have a look into the separate branch approach for future changes.

tbowmo pushed a commit to tbowmo/Arduino that referenced this pull request Jul 14, 2016
Updated led_remote example to use correct var on line 172
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants