Skip to content
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

Get IP fast in non-async examples #401

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Jan 4, 2024

I never experienced this with my old router but now getting the IP from DHCP takes multiple seconds for the non-async examples while it's blazing fast for the async examples.

Just changed the examples to construct the network stack after the connection to the AP is successful fixes that.
(basically, why embassy-net is so much faster is embassy-rs/embassy#2104 ... which explains why the changes here do the trick)

@MabezDev
Copy link
Member

MabezDev commented Jan 4, 2024

Would it be better to have a bulletproof method of doing this, instead of relying on the order of calls? I guess we can track link state change in a similar way to embassy and then reset the DHCP socket within our stack?

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Jan 4, 2024

Yeah, was thinking about it - just felt a bit lazy but since you unmasked me, I will have a look 👍

@MabezDev
Copy link
Member

MabezDev commented Jan 4, 2024

Hehe, if it becomes a bunch of work then we can merge this as is, and open an issue for a more robust solution in the future.

@bjoernQ bjoernQ force-pushed the improve-non-async-wifi-examples branch from 786b5d8 to 9876c9f Compare January 4, 2024 13:52
@bjoernQ
Copy link
Contributor Author

bjoernQ commented Jan 4, 2024

Hehe, if it becomes a bunch of work then we can merge this as is, and open an issue for a more robust solution in the future.

Turned out doing the right things wasn't that bad 😆

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@MabezDev MabezDev merged commit 2a62579 into main Jan 4, 2024
8 checks passed
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