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

Multiple Listeners on Multihomed Host #66

Open
btribley opened this issue Mar 16, 2021 · 1 comment
Open

Multiple Listeners on Multihomed Host #66

btribley opened this issue Mar 16, 2021 · 1 comment

Comments

@btribley
Copy link

btribley commented Mar 16, 2021

I need three separate MODBUS slave servers listening on three different interfaces. Right now in file ModbusSlaveTCP.java:

synchronized public void listenImpl() throws ModbusIOException {
        try {
            server = new ServerSocket(tcp.getPort());

will respond to requests from any interface. I want this:

synchronized public void listenImpl() throws ModbusIOException {
        try {
            server = new ServerSocket(tcp.getPort(),100,tcp.getHost());

but don't want to screw the library up. Thinking that if tcp.getHost() returns something other than 0.0.0.0 then do the one that restricts the interface. The 100 is a default backlog, we could default it to 10 and add a constructor to TcpParameters to specify it if it comes to that.

Thoughts? I can do a pull for this, I am actively working a project with a short deadline... First thought was to just change it then go back and do it right!

@shdk
Copy link

shdk commented Mar 25, 2021

There is already PR #61 for exactly the same thing. It is still pending to be merged though.

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