vfafou Well-Known Member Licensed User Longtime User Jul 22, 2016 #1 Hello! I would like to ask you if a websocket server could push map collection type to devices. If yes, which is the way to do that? Thank you in advance!
Hello! I would like to ask you if a websocket server could push map collection type to devices. If yes, which is the way to do that? Thank you in advance!
narek adonts Well-Known Member Licensed User Longtime User Jul 23, 2016 #2 As I remembwr b4j websocket can send only strings. So the easiest way is to use convert the map to json string with JsonGenerator Upvote 0
As I remembwr b4j websocket can send only strings. So the easiest way is to use convert the map to json string with JsonGenerator
imbault Well-Known Member Licensed User Longtime User Jul 23, 2016 #3 Correct Json or Xml is the best way Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 24, 2016 #4 Another way (which I would have chosen) is by serializing the map to an array of bytes with B4XSerializator and then use StringUtils.EncodeBase64 to convert the bytes to a string. Upvote 0
Another way (which I would have chosen) is by serializing the map to an array of bytes with B4XSerializator and then use StringUtils.EncodeBase64 to convert the bytes to a string.