B4J Question Websocket Confusion

paddy12309

Member
Licensed User
Hi Everyone,

Again I think I'm missing something but am stuck. I have a raspberry pi server running and want it to use a websocket to tell clients when somethings been updated so they know to go check for data. At the minute from looking at the example I have this on the server;

B4X:
'WebSocket class
Sub Class_Globals
    Private ws As WebSocket
End Sub
Public Sub Initialize
   
End Sub
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
    ws = WebSocket1
   
End Sub
Sub SendText (Text As String)
    Dim check As String
    check = "JSON-CHECKED"
End Sub
Private Sub WebSocket_Disconnected
End Sub

All it needs to do is send something (JSON-CHECKED) the client pi can receive and know to run a process.
Having never used websockets I'm a bit lost as to what the client needs..

Any helps much appreciated
Paddy
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top