B4J Question with websocket to send json

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

Could i send following json with websocket to other b4j App ?

B4X:
{
  "DIVal": [
    {
      "Ch":0,
      "Md":0,
      "Stat":1,
      "Val":1,
      "Cnting":0,
      "ClrCnt":0,
      "OvLch": 0
    },
    {
      "Ch":1,
      "Md":0,
      "Stat":0,
      "Val":0,
      "Cnting":0,
      "ClrCnt":0,
      "OvLch": 0
    },
    {
      "Ch":2,
      "Md":1,
      "Stat":0,
      "Val":3378,
      "Cnting":1,
      "ClrCnt":0,
      "OvLch": 0
    },
    {
      "Ch":3,
      "Md":3,
      "Stat":0,
      "Val":1,
      "Cnting":0,
      "ClrCnt":0,
      "OvLch": 0
    }
  ]
}
 

billzhan

Active Member
Licensed User
Longtime User
Use jWebSocketClient(wsc) to connect B4J Websocket server. wsc send text(JSON string. Binary data not supported) to B4J websocket endpoint in format:
{type: "event", event: "b4jwsc_event", params: {"para":<Params_map>}}


B4X:
Private Sub b4jwsc_event (Params As Map)     
   '  Params is the map -->  <Params_map>
End sub
 
Upvote 0
Top