Keep Those WebSocket Connections Alive!

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии •

  • @emooboyz
    @emooboyz Год назад +1

    hi, when user put their phone on sleep mode, the ws connection is close, all the message during that time is not sending,how to deal with this

    • @covalence-io
      @covalence-io  Год назад

      If the device closes the connection, it won't be possible to receive those messages until the connection is re-established... once the connection is re-established you'll need to grab the data that was created while the connection was down and handle the integration of everything

  • @fredcarefree
    @fredcarefree 5 месяцев назад

    great tutorial! these aren't actual websocket control frames correct, as those aren't exposed in the NodeJS ws api? this is a home-brew ping/pong/keepalive just using a simple binary msg that is agreed upon by server and client?

  • @SIDDHANTKUMARSingh10on10
    @SIDDHANTKUMARSingh10on10 8 месяцев назад

    is it optimal enough to have the interval on the server side ?

  • @klue2708
    @klue2708 3 месяца назад

    Hi, isn't the web socket has the default heartbeat feature. What is the difference between this implementation and the default heartbeat supoported by socket?

    • @covalence-io
      @covalence-io  3 месяца назад

      I'm honestly not aware of any native heartbeat functionality for websockets, but if you have a link to some documentation, send it over!

    • @klue2708
      @klue2708 3 месяца назад

      @@covalence-io Hi, I didn't see it in the docs as well. But if you open the network tab in dev tool and inspect the socket connection there, you will it will send heartbeat per 3-5 seconds.

  • @darkfire988
    @darkfire988 9 месяцев назад

    What is the idea for instant streaming function? Like the server is sending something and as soon as send it is received by everyone.
    Websocket sucks on instant data transfer.
    I mean it can't be used to transfer continues like every 10 millisecond 😢

    • @covalence-io
      @covalence-io  9 месяцев назад

      websockets are pretty much the best solution we currently have for real time data reception. if your current web socket solution is too slow, you may need more instances or better instances to handle the load.

    • @darkfire988
      @darkfire988 9 месяцев назад

      @@covalence-io I got it. Now is working as expected. My case was running interval in server and stream it🔥

    • @rusmaakatupal4723
      @rusmaakatupal4723 6 месяцев назад

      If you are running at 10 milliseconds my guess is you've set your websockets on port 403... Hey, use UDP protocal for video it is lightening fast ! With udp you have no encryption and you may loose a few packets on the road though. Luckly there are solutions for detecting and handeling corrupt packages.

  • @joelnjoroge7202
    @joelnjoroge7202 5 месяцев назад

    Thank you very much.

  • @PedroDemeu
    @PedroDemeu Год назад

    This solution can be applyed in context: "Navigator was minimized and socket connection lost"?

    • @covalence-io
      @covalence-io  Год назад +1

      It sounds like your client is ending the connection when the browser is minimized. Generally the client should explicitly end the connection in this case... but the heartbeats are essentially a catch all that will allow the server and/or client to "realize" the connection no longer exists. You most likely need to implement good reconnect logic in your client to make sure it can pick it back up when it needs to.

    • @PedroDemeu
      @PedroDemeu Год назад

      @@covalence-io thanks

  • @dashaxedit
    @dashaxedit Год назад

    Can you please make a video on the actual way how to recconect if the connection closed? It'd be more helpful if you could make a video for flutter - client

    • @covalence-io
      @covalence-io  Год назад +1

      Reconnecting is the same as connecting... you simply instantiate a new websocket instance

    • @dashaxedit
      @dashaxedit Год назад

      @@covalence-io Thank you for the quick response

    • @vasylnahuliak
      @vasylnahuliak Год назад

      @@covalence-io But current subscriptions do not run again

  • @domoledlight
    @domoledlight 11 месяцев назад

    top tuto thanks

  • @paulsanchez5030
    @paulsanchez5030 Год назад +1

    this video does not have the view or thumbs it deserves,

  • @dfage33
    @dfage33 8 месяцев назад

    websockets are just bad tech. garbage.