B4J Question Reconnect websockets

Discussion in 'B4J Questions' started by wl, Apr 27, 2019.

  1. wl

    wl Well-Known Member Licensed User


    I'm trying to implement websockets between a B4J client and a B4J server. this goes well, but I need some heartbeat mechanism so a connection drop is detected and the connection remade.

    Implementing this with ping-pong messages and timers really gets messy an not workable (websockets not being cleared, ...)

    I know there are reconnect websockets in a webbrowser implementation, but how to do this in B4J/B4I/B4A <-> B4J communication ?

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. wl

    wl Well-Known Member Licensed User

    Thanks, but I could not create a 100% failsafe solution.

    Instead I poll the server now every few minutes and launch a websocket each time in between. So if the websocket drops, a new one will be reconnected after this interval.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice