Closed nagisa closed 7 months ago
Hi there, I think the current best solution would be to bind to 0.0.0.0
or maybe 127.0.0.1
if you only allow local connections. We're not sure if we can currently implement your specific request. Feel free to open a PR.
Unfortunately the machine I'm looking to run this on has multiple interfaces and velbus should only be made available on some of them (but it does need to be available outside of local machine.)
We're not sure if we can currently implement your specific request. Feel free to open a PR.
Thank you for letting me know about your availability, I’ll probably hack on this this weekend and see about making that PR.
I made a pull request for this at #14.
Hey all,
it is possible to ask
velbustcp
to bind to a specific interface by specifying its IP address, for example as such:However, it is possible that at the time
velbustcp
is started that this address is not assigned to any of the interfaces quite yet. This can be something as simple as it being a WiFi address, and the WiFi connection has not been established yet, it could be an address that is (statically) assigned via DHCP (and DHCP did not respond yet), or it could be a simple service start up race condition, where the velbustcp service attempts to start up before the network interfaces are completely set up. I believe an issue also can come up if the network interface that the socket is bound to is disconnected and later reconnected.In those instances you're prone to see a log print out like this:
and continue running in a state of degraded functionality – it is connected to the velbus installation, but it does not present a server to other clients wanting to connect. It would be ideal if
velbustcp
attempted to recreate the listening socket occasionally, or on systems that support them used options likeIP_FREEBIND
.