J
J
JackShcherbakov2018-02-15 10:40:44
PHP
JackShcherbakov, 2018-02-15 10:40:44

How to send data to the client without requesting this data by the client itself?

Hello! I understand how to implement communication between the server and the client, for example, sending a form to the server, which in turn will send a response. In the case of a form, the server sends a response to the client's request.
But what if there are 2 clients? For example, the 1st submits the form, and the processing results come to the 2nd automatically.
How it is possible to make so that at sending the form 1-sun the processing results would come to the 2nd client. In this case, the 2nd client must always be ready to catch the answer. That is, on the 2nd client, XmlHTTPRequest must be sent to the server when the server has already processed the data that came from the 1st client. If you didn’t understand much, then here is the algorithm of this process:
1. Submitting the form by the 1st client
2. Processing the data and compiling the result (JSON)
3. Sending this JSON to the 2nd client
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Well here again 25, 2018-02-15
@TT55EE

WebSocket is hard
try SSE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question