B4J Question Web socket server, user type serialization

Mostez

Well-Known Member
Licensed User
Longtime User
I've implemented simple B4J Web Socket Server for ESP. Is it possible to serialize objects (user defined type) instead of string? I want to do something like
Server:
B4J:
Type Info(ID As String, Name As String, MyArray() As Byte)
B4J:
Private ws As WebSocket
ws.RunFunction("ScheckPointInf", Array As Object("E00",Info))

Client:
B4R:
Type Info(ID As String, Name As String, MyArray() As Byte)
B4R:
Sub WebSocket_NewMessage (FunctionName As String, Params() As Object)
    Select FunctionName
        Case "ScheckPointInf"
           Dim Inf as info = Parms(1)
            Log("Name: ", Inf.Name)
    End Select
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
This works with B4A,B4J, probably B4i too. convertbytestoobject is used to get the type back from the serialized bytes.

Don´t know it that works on the ESP.. don´t know it rRandomAccessfile is compatible too. Never worked with B4R.
 
Upvote 0
Top