B
B
Banan442020-05-25 13:38:19
Socket.io
Banan44, 2020-05-25 13:38:19

Why are volatile messages needed in socket.io?

Very little is written about them in the documentation and nothing is clear at all, can you tell me why they are needed? How is socket.volatile.emit different from socket.emit? I would like to receive a detailed answer with a real example where it can be useful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2020-05-25
@Banan44

Everything is described there with a live example.
There is data sending which is not that much required.
And socket.io, by default, apparently checks whether the message was delivered or not. If not delivered tries to send again.
If someone did not receive it initially due to, for example, slow Internet or some other reason, then the server will not try to resend volatile messages, unlike regular ones.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question