labcold Member Licensed User Longtime User May 13, 2020 #1 I am building a system which needs simple lightweight MQTT broker so as all the apps connected are in B4X I thought I could use jMqttBroker. However there are 2 NICs in the system; one for the connected devices network and one external. I want to run the MQTT broker ONLY on the internal LAN NIC but there is no apparent way to bind it to a specific IP address (reports 0.0.0.0). Is it possible? Could it be made possible? to bind to a specific NIC address? Or do I need to run Mosquito or similar?
I am building a system which needs simple lightweight MQTT broker so as all the apps connected are in B4X I thought I could use jMqttBroker. However there are 2 NICs in the system; one for the connected devices network and one external. I want to run the MQTT broker ONLY on the internal LAN NIC but there is no apparent way to bind it to a specific IP address (reports 0.0.0.0). Is it possible? Could it be made possible? to bind to a specific NIC address? Or do I need to run Mosquito or similar?
Erel B4X founder Staff member Licensed User Longtime User May 14, 2020 #2 Try this: Code: Copy Dim jo As JavaObject = broker Dim properties As JavaObject = jo.GetField("properties") properties.RunMethod("setProperty", Array("host", "ip address of correct host")) 'StartServer Upvote 0
Try this: Code: Copy Dim jo As JavaObject = broker Dim properties As JavaObject = jo.GetField("properties") properties.RunMethod("setProperty", Array("host", "ip address of correct host")) 'StartServer
labcold Member Licensed User Longtime User May 15, 2020 #3 Superlative Thank you Erel, works a treat! I'm always so impressed and thankful for the generous, helpful, accurate and fast response from this community plus astoundingly good product set Upvote 0
Superlative Thank you Erel, works a treat! I'm always so impressed and thankful for the generous, helpful, accurate and fast response from this community plus astoundingly good product set