V
V
v- death2015-11-20 00:11:27
JavaScript
v- death, 2015-11-20 00:11:27

How to correctly synchronize chat between ajax and web socket version?

Hello. There is a chat on web sockets. I successfully write all messages to the database and they are immediately visible in the Ajax version. But ajax version messages are not visible in version seket.

There is only one solution. How to synchronize the database with an array of messages.
It's just that I don't understand how to do it.
Thanks in advance for your help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
link_irk, 2015-11-20
@vGrabko99

Write a WebSocket client in your AJAX handler. Thus, when receiving AJAX requests, you will be able to transfer information to the web socket server (for example, a request to update data)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question