Websocket transport reliability (Socket.io data loss during reconnection)

前端 未结 8 2441
梦谈多话
梦谈多话 2020-12-02 04:58

Used

NodeJS, Socket.io

Problem

Imagine there are 2 users U1 & U2, connected to an app via Socket.io. The al

8条回答
  •  天涯浪人
    2020-12-02 05:26

    Been looking at this stuff latterly and think different path might be better.

    Try looking at Azure Service bus, ques and topic take care of the off line states. The message wait for user to come back and then they get the message.

    Is a cost to run a queue but its like $0.05 per million operations for a basic queue so cost of dev would be more from hours work need to write a queuing system. https://azure.microsoft.com/en-us/pricing/details/service-bus/

    And azure bus has libraries and examples for PHP, C#, Xarmin, Anjular, Java Script etc.

    So server send message and does not need to worry about tracking them. Client can use message to send back also as means can handle load balancing if needed.

提交回复
热议问题