Currently, most of the messenger functions have been completed, but the problem is that they are bringing the most recent conversation together by distributing the list of chat rooms. (ex. Kakao Talk)
The problem is that when someone sends a message in the chat room, you need to update the message you received recently and re-mark it on the list
setInterval(function() {
socket.emit('rooms', id);
}, 1000);
Should I keep bringing up the list of rooms in this form...? If so, the list shown will keep blinking and the server will be burdened...
What should I do?
node.js mongoose socket.io
Well, The source code must be the client part.
It appears to be a problem that only needs to be handled when the client receives a server event with socket.on.
You can only retrieve the information and show it again if you receive a new message from the server. It's not interval as it is now.
© 2024 OneMinuteCode. All rights reserved.