You have to sent a JSON string to the server in the following format:
{type: "event", event: xxxx, params: { p1name: p1value, p2name: p2value, ... } }
Where xxxx is the sub name that will be called on the B4J side. This sub name needs to include an underscore (_). So valid sub name:
subscribe_currency
Invalid subname:
suscribeCurrency
The params value is another JSON map that contains 0 or more key values itself. This map will be converted to a B4J map and will be passed on as the parameter for the sub that is called.
So sending
{type: "event", event: "hello_world", params: {firstname: "John", lastname: "Doe"}}
And having the following code in the Server Socket Handler routine
Public Sub hello_word(values As Map)
Log($"Hello ${values.GetDefault("firstname", "Nothing")} ${values.GetDefault("lastname", "Nothing")}"$)
End Sub
Should log
on the server side.
Note: Code not tested. May contain show stopping typos.