narek adonts Well-Known Member Licensed User Longtime User May 7, 2019 #1 Hi, I am making a mesanging application and I decided to make the backend in b4j. I was thinking to using mqtt broker as the server but without some events of the broker it is not possible (authorizations,...) And I decided to use jServer with websockets. But it seems that in jServer websockets only support support String to send and receive data. Is there a way to send/receive bytes instead of string? Narek
Hi, I am making a mesanging application and I decided to make the backend in b4j. I was thinking to using mqtt broker as the server but without some events of the broker it is not possible (authorizations,...) And I decided to use jServer with websockets. But it seems that in jServer websockets only support support String to send and receive data. Is there a way to send/receive bytes instead of string? Narek
BillMeyer Well-Known Member Licensed User Longtime User May 7, 2019 #2 Maybe rethink the MQTT option. If you install your own Mosquitto broker and read the following article - it might just help http://www.steves-internet-guide.com/topic-restriction-mosquitto-configuration/ Upvote 0
Maybe rethink the MQTT option. If you install your own Mosquitto broker and read the following article - it might just help http://www.steves-internet-guide.com/topic-restriction-mosquitto-configuration/
OliverA Expert Licensed User Longtime User May 7, 2019 #3 narek adonts said: Is there a way to send/receive bytes instead of string? Click to expand... B4J's jServer WebSocket implementation does not support binary data directly. One way around that would be to Base64 encode the data. Note that jServer has a limit on how much can be transferred at one time via WebSockets (the limit can be changed. See https://www.b4x.com/android/forum/threads/websocket-received-data-exceeds-limit.90678/). You could also use WebSockets for textual communications and regular server handlers for binary transfers (see https://www.b4x.com/android/forum/threads/sending-binary-data-over-websocket.44776/#post-273894). Upvote 0
narek adonts said: Is there a way to send/receive bytes instead of string? Click to expand... B4J's jServer WebSocket implementation does not support binary data directly. One way around that would be to Base64 encode the data. Note that jServer has a limit on how much can be transferred at one time via WebSockets (the limit can be changed. See https://www.b4x.com/android/forum/threads/websocket-received-data-exceeds-limit.90678/). You could also use WebSockets for textual communications and regular server handlers for binary transfers (see https://www.b4x.com/android/forum/threads/sending-binary-data-over-websocket.44776/#post-273894).
narek adonts Well-Known Member Licensed User Longtime User May 8, 2019 #4 OliverA said: B4J's jServer WebSocket implementation does not support binary data directly. One way around that would be to Base64 encode the data. Note that jServer has a limit on how much can be transferred at one time via WebSockets (the limit can be changed. See https://www.b4x.com/android/forum/threads/websocket-received-data-exceeds-limit.90678/). You could also use WebSockets for textual communications and regular server handlers for binary transfers (see https://www.b4x.com/android/forum/threads/sending-binary-data-over-websocket.44776/#post-273894). Click to expand... Thank u. I know this )) I thought that maybe we could add some Java code to add the functionality Upvote 0
OliverA said: B4J's jServer WebSocket implementation does not support binary data directly. One way around that would be to Base64 encode the data. Note that jServer has a limit on how much can be transferred at one time via WebSockets (the limit can be changed. See https://www.b4x.com/android/forum/threads/websocket-received-data-exceeds-limit.90678/). You could also use WebSockets for textual communications and regular server handlers for binary transfers (see https://www.b4x.com/android/forum/threads/sending-binary-data-over-websocket.44776/#post-273894). Click to expand... Thank u. I know this )) I thought that maybe we could add some Java code to add the functionality
narek adonts Well-Known Member Licensed User Longtime User May 8, 2019 #5 OliverA said: B4J's jServer WebSocket implementation does not support binary data directly. One way around that would be to Base64 encode the data. Note that jServer has a limit on how much can be transferred at one time via WebSockets (the limit can be changed. See https://www.b4x.com/android/forum/threads/websocket-received-data-exceeds-limit.90678/). You could also use WebSockets for textual communications and regular server handlers for binary transfers (see https://www.b4x.com/android/forum/threads/sending-binary-data-over-websocket.44776/#post-273894). Click to expand... The problem is not only authorization. Some backend work like add to database, notification, ... lot of things must be done. ACL file is not a good solution if the ACL file is too large, so if the users increase it will be an issue Upvote 0
OliverA said: B4J's jServer WebSocket implementation does not support binary data directly. One way around that would be to Base64 encode the data. Note that jServer has a limit on how much can be transferred at one time via WebSockets (the limit can be changed. See https://www.b4x.com/android/forum/threads/websocket-received-data-exceeds-limit.90678/). You could also use WebSockets for textual communications and regular server handlers for binary transfers (see https://www.b4x.com/android/forum/threads/sending-binary-data-over-websocket.44776/#post-273894). Click to expand... The problem is not only authorization. Some backend work like add to database, notification, ... lot of things must be done. ACL file is not a good solution if the ACL file is too large, so if the users increase it will be an issue