P
P
puglsey2021-06-27 04:13:29
Chats
puglsey, 2021-06-27 04:13:29

How were online chats done before?

Good afternoon!

WebSockets appeared in 2010, Ajax in 2005.

How were online chats made before the advent of Ajax and WebSockets?
I remember in 2003-2004 there were chats on narod.ru and it was updated without reloading the page, how was it possible to implement online chats at that time?

UPD: most likely with a flash.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladislav Lyskov, 2021-06-27
@puglsey

Yes, in flash

M
mletov, 2021-06-27
@mletov

Frames

R
rPman, 2021-06-27
@rPman

Somewhere in 2007, long pooling technology appeared (maybe earlier, but it got its name then).
There is a script on the backend that does not return (is in the standby mode, i.e. sleep) data until it is necessary to send a message to the client.
At the same time, there was no ajax as such (xhtmlrequest appeared just in 2007), and in order to receive data from the server, it was easiest to generate javascipt initialization constants for this data, passed to the function that is a callback for receiving them. Accordingly, to start waiting for a message on the client, you need to connect a script with the appropriate url in the script tag.
To prevent a long connection from being closed, long poling must periodically send some data while waiting, for example, a space once a minute.
as a result, the backend forms with a pause and returns a script like:

................................
messageReceived({user:'vasya',message:'Hi!'});

ps small chats did not disdain periodic updates, on the timer, I saw a local chat, which the list of messages was presented as html inside an iframe, in which meta refresh was written to be updated every 5 seconds

R
Romses Panagiotis, 2021-06-27
@romesses

Comet Technology .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question