May 14, 2014 Replies: 13 Note: this library depends on jetty_b4j.jar, which is included in jServer3.zip: https://www.b4x.com/android/forum/threads/jserver3.141323/#content With this library you can implement WebSocket clients. The API is identical to the B4A library: http://www.b4x.com/android/forum/threads/websocket-client-library.40221/#content (except of the object name which is WebSocketClient). It is based on Jetty WebSocket client implementation. The push client example was ported to B4J: http://www.b4x.com/android/forum/threads/custom-websocket-based-push-framework.40272/ This means that you can now implement an (almost) always connected solution with bi-directional communication running on Androids, desktops and browsers. This is an internal library. Updates: v1.13 - New SendTextAsync and SendBinaryAsync methods. Do not use SendText / SendBinary. By mistake they are sending the messages on the main thread which can lead to bad things. The old methods are kept for backward compatibility. Attachments WebSocketPush.zip WebSocketPush.zip 5.8 KB · Views: 2,996 Last edited: Dec 4, 2022 Click to expand...
Note: this library depends on jetty_b4j.jar, which is included in jServer3.zip: https://www.b4x.com/android/forum/threads/jserver3.141323/#content With this library you can implement WebSocket clients. The API is identical to the B4A library: http://www.b4x.com/android/forum/threads/websocket-client-library.40221/#content (except of the object name which is WebSocketClient). It is based on Jetty WebSocket client implementation. The push client example was ported to B4J: http://www.b4x.com/android/forum/threads/custom-websocket-based-push-framework.40272/ This means that you can now implement an (almost) always connected solution with bi-directional communication running on Androids, desktops and browsers. This is an internal library. Updates: v1.13 - New SendTextAsync and SendBinaryAsync methods. Do not use SendText / SendBinary. By mistake they are sending the messages on the main thread which can lead to bad things. The old methods are kept for backward compatibility.
W wl Well-Known Member Licensed User Longtime User May 14, 2014 #2 Hi Erel, As far as I know the library already existed for a few weeks: is there anything new in this library that made you create this post about an hour ago ? Or has the B4J client library been added ? Thanks
Hi Erel, As far as I know the library already existed for a few weeks: is there anything new in this library that made you create this post about an hour ago ? Or has the B4J client library been added ? Thanks
Erel B4X founder Staff member Licensed User Longtime User May 14, 2014 #3 This is the B4J additional libraries forum => This is a B4J library.
B billzhan Active Member Licensed User Longtime User May 14, 2014 #4 Great. Works fine on b4j 2.2beta1.
W wl Well-Known Member Licensed User Longtime User May 14, 2014 #5 Erel said: This is the B4J additional libraries forum => This is a B4J library. Click to expand... Stupid me...
Erel said: This is the B4J additional libraries forum => This is a B4J library. Click to expand... Stupid me...
Silv Member Licensed User Longtime User Jul 30, 2014 #6 Hi Erel can you give me the code of your server in the samples? ws://basic4ppc.com:51042/push/b4a_ws2 this one
Hi Erel can you give me the code of your server in the samples? ws://basic4ppc.com:51042/push/b4a_ws2 this one
Erel B4X founder Staff member Licensed User Longtime User Aug 1, 2014 #7 All of the online examples code is available here: http://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/
All of the online examples code is available here: http://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/
KY Leng Active Member Licensed User Longtime User Oct 6, 2015 #8 Hi Erel, I am not sure whether the server can be implemented on android device or not? Secondly, do we need static IP for the server or only hosting is enough ? Best regards,
Hi Erel, I am not sure whether the server can be implemented on android device or not? Secondly, do we need static IP for the server or only hosting is enough ? Best regards,
Erel B4X founder Staff member Licensed User Longtime User Oct 6, 2015 #9 No. The server is implemented in B4J. Which means that it can run on Windows, Linux (including arm boards) or Macs. You do not need a static ip address. However you will need to use a dynamic dns service. See this tutorial: https://www.b4x.com/android/forum/t...r-b4j-server-over-the-internet.37201/#content
No. The server is implemented in B4J. Which means that it can run on Windows, Linux (including arm boards) or Macs. You do not need a static ip address. However you will need to use a dynamic dns service. See this tutorial: https://www.b4x.com/android/forum/t...r-b4j-server-over-the-internet.37201/#content
victormedranop Well-Known Member Licensed User Longtime User Dec 17, 2016 #10 Is there a way to stop the server and free the tcp port used? Regards, Victor
Erel B4X founder Staff member Licensed User Longtime User Dec 18, 2016 #11 This thread is about the WebSocket client library. Please start a new thread for your question.
Erel B4X founder Staff member Licensed User Longtime User Dec 4, 2022 #12 v1.13 - New SendTextAsync and SendBinaryAsync methods. Do not use SendText / SendBinary. By mistake they are sending the messages on the main thread which can lead to bad things. The old methods are kept for backward compatibility.
v1.13 - New SendTextAsync and SendBinaryAsync methods. Do not use SendText / SendBinary. By mistake they are sending the messages on the main thread which can lead to bad things. The old methods are kept for backward compatibility.
xulihang Well-Known Member Licensed User Longtime User Feb 18, 2023 #13 Does the library work with B4J v9.8? I can't get it to connect to a websocket jServer. Edit: It turns out to be the new filter I added which causes the problem. B4X: Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean resp.SetHeader("Access-Control-Allow-Private-Network","true") Return False End Sub
Does the library work with B4J v9.8? I can't get it to connect to a websocket jServer. Edit: It turns out to be the new filter I added which causes the problem. B4X: Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean resp.SetHeader("Access-Control-Allow-Private-Network","true") Return False End Sub
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2023 #14 xulihang said: Does the library work with B4J v9.8? Click to expand... Yes.