B4J Question websockets - browser code ?

wl

Well-Known Member
Licensed User
Longtime User
Hi,

I have gathered the necessary server and client code to use websockets. But I'm missing some instructions on how it works in a browser ?

There used to be a chat demo but it is no longer available ?

Tx
 

wl

Well-Known Member
Licensed User
Longtime User
Erel,

As far as websockets in a browser is concerned. Would it mean that something like the following works:

Server-side:

B4X:
    ws.RunFunction("myFunction", SomeArrayOfStrings)

Browser-side:

B4X:
  function myFunction() {
    var i;
    for (i = 0; i < arguments.length; i++) {
       ... arguments[i] ... 'is each item in the SomeArrayOfStrings I defined server-side.
    }
  }

Would I need to pass an array of strings, a list of string, or would both work out ?

Thanks !
 
Upvote 0
Top