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:
Code: Copy
Type Info(ID As String, Name As String, MyArray() As Byte)
Code: Copy
Private ws As WebSocket
ws.RunFunction("ScheckPointInf", Array As Object("E00",Info))

Client:
Code: Copy
Type Info(ID As String, Name As String, MyArray() As Byte)
Code: Copy
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
 
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
Back
Top