J
J
JRazor2017-12-17 21:42:20
Socket.io
JRazor, 2017-12-17 21:42:20

SocketJS: process all messages through one socket or open multiple?

In general, you need a chat that is similar to LinkedIn. SocketJS has a multi-connect feature. But the question is - what is the advantage of this method and the disadvantages over a single-socket connection and message processing on the client? And how does this difference affect performance and load?

Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2017-12-17
@JRazor

Chat makes no difference. It is better to drive all data through one socket. Memory will be used less, both on the server and on the client.
If you have a lot of traffic ala video, then it is better to use a separate socket for video-audio, or work via UDP. That. if there is a queue in one socket, then the second one will always be free + the signal traffic is not as big as audio-video.
In this case: chat is a signaling protocol and there is no point in bothering with additional sockets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question