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 capability to bind the Socket to specific local interface. #135

Closed
tamiradler opened this issue Dec 25, 2022 · 2 comments
Closed

Add capability to bind the Socket to specific local interface. #135

tamiradler opened this issue Dec 25, 2022 · 2 comments

Comments

@tamiradler
Copy link

tamiradler commented Dec 25, 2022

in the method com.ghgande.j2mod.modbus.net.TCPMasterConnection.connect(boolean), need the ability to bind the Socket to specific interface.

@steveohara
Copy link
Owner

Can you explain the use case you have for this?
I'm struggling to understand why you wouldn't want to just rely on the OS to select the correct adapter for an outbound connection. The OS will figure out which network card to use based on your destination address and for that it uses routing tables etc.

@steveohara
Copy link
Owner

It was easy enough to add but tricky to test so there are no unit tests for it.
I would appreciate it if you could take the snapshot for a spin and let me know if it meets your needs.
New getter/setter added to TCPMasterConnection to allow the user to select a network interface to bind to.

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