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

Add bind address to CoAPClient::new() #15

Closed
robbym opened this issue Sep 14, 2017 · 2 comments
Closed

Add bind address to CoAPClient::new() #15

robbym opened this issue Sep 14, 2017 · 2 comments

Comments

@robbym
Copy link

robbym commented Sep 14, 2017

So by default CoAPClient::new() binds to 0.0.0.0:0 for Ipv4 and :::0 for Ipv6.
I have the need to use Ipv6's scope_id when binding, so I can specify which interface I want the packet to go out on. SocketAddrV6::new() lets me specify the scope_id I want to use, but the current CoAPClient assumes I want :::0. Allowing the user to pass in another ToSocketAddrs for the bind address would alleviate this issue.

I have forked the repo and made the change so I can continue working, but it'd be cool if the main repo had support for it. Change is here: robbym@4fa038d

To prevent API breakage, maybe a different function that takes both the bind address and destination address?

@Covertness
Copy link
Owner

Thank you for your advice. I will add another construct function new_with_specific_source.

@Covertness
Copy link
Owner

code updated: 499c01a.

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

No branches or pull requests

2 participants