I AM NOT EXPECTING ANY SUPPORT FROM ANYWHERESOFTWARE PEOPLE OR FROM EREL GIVEN THE CURRENT TRAGIC SITUATION IN ISRAEL.
Hi,
strange case..for the 2 scenarios described below, in case 1 I get both connected and disconnected events on client app side.
in case 2, I only get the connected event but NOT the disconnected. only difference is that the broker is running in Rpi. Actually there is a small difference. in case one to fire the disconnection on client side, I stop the B4j broker app, while in case 2 I reboot the Rpi. Can it be the reason?
case 1: mqtt broker running in a B4J pc non ui application as:
broker.Initialize("", 51041)
broker.SetUserAndPassword(user,pw)
broker.Start
broker.DebugLog = False
mqtt client running on a B4J UI app:
'''''''''''''''
Dim clientId As String = Rnd(0, 999999999) & DateTime.Now 'create a unique id
mqtt.Initialize("mqtt", "tcp://192.168.1.11:51041", clientId)
Dim mo As MqttConnectOptions
mo.Initialize(user, password)
mqtt.Connect2(mo)
''''''''''
Sub mqtt_Connected (Success As Boolean)
Log("Connected event:" & Success)
If Success = False Then
Log(LastException)
Else
Log("client Connected")
mqtt.subscribe("#",0)
End If
End Sub
Private Sub mqtt_Disconnected
Log("Disconnected")
End Sub
Case 2: same as case 1 only that the Broker is running in a Rpi as B4j non ui application. same code for broker. client side, same client, same code.