B4A Library [B4X] FTP Server implemented with Socket and AsyncStreams - Erel    Jul 18, 2022   (40 reactions)   tags: B4A B4J, FTP classes: FTPServer - There is a single instance of this class. It manages the server socket that listens... for each task that requires communication over the data socket (upload, download and list files... the channel after the data was sent (SendAllAndClose). Clients expect the data socket to be closed after... with network sockets. https://www.b4x.com/basic4android/images/SS-2016-12-19_16.47.26.png Updates V1.10... B4A Library WebSocket Client Library - Erel    Apr 22, 2020   (21 reactions)   tags: web, WebSocket, api This library allows you to create WebSocket connections with servers that support WebSockets... a class named WebSocketHandler. With this class you can send events to the server and the server can send... As WebSocket Private timer1 As Timer End Sub Public Sub Initialize End Sub Private Sub WebSocket_Connected (WebSocket1 As WebSocket) ws = WebSocket1 timer1.Initialize("timer1", 1000...: " & Params.Get("message")) End Sub Private Sub WebSocket_Disconnected... B4J Library jWebSocketClient library - Erel    Dec 4, 2022   (15 reactions) 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... Wish jWebSocketClientV2 - OliverA    Oct 22, 2023   (5 reactions) I wish for a jWebSocketClient library (that can have a different name, so as to keep the jWebSocketClient library that's based on Jetty3) that is based on the latest Jetty revision that is included in the latest B4J. This may resolve the Web Socket connect issues found on this forum when it comes to using the Jetty 3 based jWebSocketClient library against the Jetty 4 Server included in the latest B4J.... B4J Question jWebSocketClient - cant connect - Alexander Stolte    Oct 11, 2023 .websocket.api.UpgradeException: 0 null at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:515) at org.eclipse.jetty.client.ResponseNotifier...=HttpReceiverOverHTTP@330c594f(rsp=IDLE,failure=null)]->SocketChannelEndPoint@4d9b97eb{b4x.com/67.227.218.133:51041<....eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:522....CompletableFuture.get(CompletableFuture.java:1999) at anywhersoftware.b4j.objects.WebSocketClientWrapper... B4A Tutorial Custom WebSocket Based Push Framework - Erel    Jul 28, 2014   (17 reactions)   tags: Push Framework, Erel The online example is currently disabled due to spam :( Now that both B4A and B4J support WebSockets it is possible to implement a full push framework solution. The solution is made of two components. The client app (B4A) and the server WebApp (B4J). The client opens and maintains a WebSocket connection with the server. http://www.b4x.com/basic4android/images/SS-2014-04-24_17.31.41.png In.... You need to first download WebSocket library (v1.01+): http://www.b4x.com/android/forum/threads... B4J Tutorial STARTTLS - upgrading a non-tls socket to a tls socket. - Erel    Aug 19, 2021   (6 reactions) to implements the TLS upgrade are: 1. Set a timeout to the network socket and set AsyncStreams... the streams without closing them. Example (using AsyncStreamsText class): Socket1.As(JavaObject).GetFieldJO("socket").RunMethod("setSoTimeout", Array(1000)) 'timeout of 1 second AST.Initialize(Me, "AST", Socket1.InputStream, Socket1.OutputStream) AST.astreams....StopWithoutClosingStreams - Call Sleep with a duration larger than the socket timeout. - Start... B4J Code Snippet jWebSocketClient v2 accept all certificates - Erel    Oct 25, 2023   (8 reactions) As WebSocketClient End Sub Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm... SetAcceptAll (WebSocket As WebSocketClient) Dim ssl As JavaObject ssl.InitializeNewInstance("org...", Array(HttpTransport)) Dim jo As JavaObject = WebSocket Dim wsc As JavaObject wsc.InitializeNewInstance("org.eclipse.jetty.websocket.client.WebSocketClient", Array(HttpClient... B4J Code Snippet [B4X] Trust all SSL Socket - Erel    Apr 21, 2021   (7 reactions)   tags: B4X Trust all SSL Socket Platforms: B4J (1st post) and B4A (2nd post) This code creates an SSL socket that doesn't... CreateTrustAllSSLSocket (EventName As String) As Socket Dim socket As Socket socket.Initialize(EventName) Dim jo As JavaObject = socket jo.SetField("socket", CreateTrustAllSSLSocketFactory.RunMethod("createSocket", Null)) Return socket End Sub Sub...(Null, tm, Null)) Dim Factory As JavaObject = SSLContext.RunMethod("getSocketFactory"... B4J Tutorial [server] Automatic Reconnecting WebSocket - Erel    Jan 6, 2016   (12 reactions)   tags: B4J Server Websocket When working with WebSocket handlers the client maintains an online connection. The connection... can be temporary broken. Especially when the client is a mobile browser. Using the Reconnecting-WebSocket... connection. In both cases a new WebSocket handler instance is created. You can use the HttpSession to restore the previous state. For example: Private Sub WebSocket_Connected (WebSocket1 As WebSocket) Log("Connected") ws = WebSocket1 Dim session As HttpSession = ws.UpgradeRequest... Page: 1   2   3   4   5   6   7   |