aaronk Well-Known Member Licensed User Longtime User Nov 8, 2018 #1 Hi, I am using a websocket in my B4i app. I am connecting it to my B4J app. I have used: Code: Copy ' Check make sure WebSocket is Initialized before trying to connect If ws.IsInitialized = False Then ws.Initialize("ws") ' connect to WebSocket server ws.Connect("wss://192.168.0.88:5001/app") The app connects to my B4J webocket server fine, and triggers the ws_Connected sub once the connection is made. (which is fine) However if I call: Code: Copy ws.Close It never triggers: Code: Copy Private Sub ws_Closed (Reason As String) Log("**Connection Lost**") Log("Reason: " & Reason) End Sub If I loose connection to my B4J Server it also doesn't Tigger the ws_Close sub. (nothing gets logged when the connection is lost.) Using B4i Version 5.00 iWebSocket Lib 1.10 Anyone know what might be wrong or what I might of missed ?
Hi, I am using a websocket in my B4i app. I am connecting it to my B4J app. I have used: Code: Copy ' Check make sure WebSocket is Initialized before trying to connect If ws.IsInitialized = False Then ws.Initialize("ws") ' connect to WebSocket server ws.Connect("wss://192.168.0.88:5001/app") The app connects to my B4J webocket server fine, and triggers the ws_Connected sub once the connection is made. (which is fine) However if I call: Code: Copy ws.Close It never triggers: Code: Copy Private Sub ws_Closed (Reason As String) Log("**Connection Lost**") Log("Reason: " & Reason) End Sub If I loose connection to my B4J Server it also doesn't Tigger the ws_Close sub. (nothing gets logged when the connection is lost.) Using B4i Version 5.00 iWebSocket Lib 1.10 Anyone know what might be wrong or what I might of missed ?
Erel B4X founder Staff member Licensed User Longtime User Nov 8, 2018 #2 It is expected not to fire when you call close as the event listener is removed. Kill the B4J server and then try to send something. It is expected to fire. Upvote 0
It is expected not to fire when you call close as the event listener is removed. Kill the B4J server and then try to send something. It is expected to fire.