169 похожих чатов

In a chat application when the user goes offline and

come online again a web socket connection is made
And the messages which was sent when the user was offline will be send to user
So when should I send those messages, should I let the user send any timestamp requesting that they want messages after this timestamp? Or the server send upon the socket connection
If that’s the case then for multi login I won’t get the messages in other phone
If i want to send the timestamp, then I need to send the timestamp of all the chats and get the message
Is there any other method to do this ?

4 ответов

12 просмотров

Websocket for realtime events, pull for historic events.

Athul-N Автор вопроса
Sebastian
Websocket for realtime events, pull for historic e...

You mean a normal http rest api to get old messages ?

Athul N
You mean a normal http rest api to get old message...

Yes. You keep the realtime code seperated from historic events. The client can listen for current events and the server can query the messages from the database in the background.

Athul-N Автор вопроса
Sebastian
Yes. You keep the realtime code seperated from his...

But I want to first show all the old messages and then the new messages

Похожие вопросы

Обсуждают сегодня

Комрады, хотел уточнить. Проперть в OnDestroy юнита-хозяина по-прежнему доступна? И еще уточнение: finalization юнита наступает раньше или позже OnDestroy?
Ed Doc
48
А как старый хаскел с новым стыковать ? потому как тут работает https://play.haskell.org/saved/C3xpMzcd, а вот тут https://stepik.org/lesson/7602/step/9?unit=1473 нет ошибка C...
Fedor
56
Вопрос, вот задание https://stepik.org/lesson/7602/step/9?unit=1473 вот код и ошибка, удивляет, что требуется еще и Semigroup так и должно быть, или я опять делаю ошибки ? htt...
Fedor
14
Вообще, меня бы даже такой вариант, наверное устроил бы: try tag.Read(0); finally end; Но этот AV не ловится и программа завершается Exception EAccessViolation in module C...
notme
12
Проблема с Windows scripting control Множество объектов получают iDispatch обертки и отдаются в скрипты. При этом скрипты могут эти обертки держать живыми очень долго, наприм...
Arioch The
16
Скажите, можно ли как-то "переместить" динамический массив из одной переменной в другую? Скажем, переместить из TList<> в TArray<>. Именно переместить, а не скопировать. Если ...
Eugene Krasnikov (ᴊɪɴ x)
37
Да и вообще... как VBS/VBA производит вызов методов тогда? Как мне на Delphi сделать точно также, блин.... VBS/VBA не падают, а возвращают нормальный СОМ-объект, где можно про...
notme
10
Всем доброго времени суток! В BDE в своё время был файл BDEINST.dll который, как я понимаю, содержал всё что нужно для инсталляции BDE. Если посмотреть на дату его создания то...
Mikhail Tchervonenko
2
Я тут пытаюсь переработать архитектуру подсистемы памяти ядра во что-то осмысленное. Есть pmm, который создает набор range’ей(пока что только для ядра, потом для юзерспейса), ...
Evg Resh
9
комрады, че-та лыжы не едут var tmpFont: TFont; begin tmpFont:= TFont.Create; try case rgFontColor.ItemIndex of 0: tmpFont.Color:= clWindowText; 1: tmpFo...
Ed Doc
34
Карта сайта