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

rumqttc: Add bind_device to NetworkOptions to enable TCPSocket.bind_device() #654

Merged

Conversation

seimonw
Copy link
Contributor

@seimonw seimonw commented Jul 3, 2023

Allows the network connection to be optionally bound to a specific interface.
See also: https://docs.rs/tokio/latest/tokio/net/struct.TcpSocket.html#method.bind_device

Type of change

New feature (non-breaking change which adds functionality)

Checklist:

  • Formatted with cargo fmt
  • Make an entry to CHANGELOG.md if its relevant of user of the library. If its not relevant mention why.

Copy link

@h3nill h3nill left a comment

Choose a reason for hiding this comment

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

else LGTM, but can you explain the use case for this?

rumqttc/src/eventloop.rs Show resolved Hide resolved
@seimonw
Copy link
Contributor Author

seimonw commented Jul 11, 2023

else LGTM, but can you explain the use case for this?

It can be used to force the connection to go via a specific network which may not be the default route. I would like to use it to maintain two independent connections to a server. I can verify the backup network route's connectivity while the primary (default) route is still active.

@seimonw seimonw force-pushed the seimonw/rumqttc-allow-bind-interface branch 2 times, most recently from 539f841 to e57156b Compare July 11, 2023 12:14
rumqttc/src/eventloop.rs Outdated Show resolved Hide resolved
rumqttc/src/lib.rs Outdated Show resolved Hide resolved
@h3nill h3nill requested a review from yatinmaan July 13, 2023 10:37
@seimonw seimonw force-pushed the seimonw/rumqttc-allow-bind-interface branch from e57156b to 267cb87 Compare July 14, 2023 08:45
@stale stale bot added the stale Not moving forward; blocked label Aug 3, 2023
@seimonw
Copy link
Contributor Author

seimonw commented Aug 3, 2023

What's the latest with this PR @henil - it seems to have stalled. Is there anything more I can do?

@stale stale bot removed the stale Not moving forward; blocked label Aug 3, 2023
@h3nill
Copy link

h3nill commented Aug 8, 2023

Hey, sorry for the delay. we have backlog of things to review and merge but we dont have enough bandwidth. I will try to get this reviewed and merged by this month.

…bind_device()

Signed-off-by: Seimon Williams <seimon@mobot.uk.com>
@seimonw seimonw force-pushed the seimonw/rumqttc-allow-bind-interface branch from 267cb87 to 07e2756 Compare August 8, 2023 08:18
@seimonw
Copy link
Contributor Author

seimonw commented Aug 8, 2023

No worries - I noticed that clippy in the workflow didn't like the #cfg(all(any from tokio so have pushed without the all in there. Sorry - I didn't see that issue locally.

@h3nill h3nill merged commit 213cea4 into bytebeamio:main Aug 20, 2023
3 checks passed
@h3nill
Copy link

h3nill commented Aug 20, 2023

Thank you @seimonw! 🎉

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