Delphi Datasnap Callback - Prompt the Client about something

0

I'm now starting to implement in Datasnap. I searched a lot but I did not find a solution, maybe because of my inexperience, I was letting something very simple go by.

I need to find a way to send a message to the clients connected to the server. For example, I want to warn such a client that they need to update, terminate their connection, or who may display a message on the user's screen.

I have read several articles and downloaded several examples about Callback, but from what I could understand, at least in the examples, is that only the client calls the Callback, he requests the server and the server responds, I have to do the opposite, it is possible ?

Thankful

    
asked by anonymous 11.08.2017 / 13:08

1 answer

0

This is possible through callback itself. Whoever triggers the callback is the server, and the client receives the message and processes.

Read this article, it explains how to implement callback on both the client and the server: link

In summary, in your client you register in a callback channel and pass a method that will be executed every time you receive a message, and on the server you trigger a broadcast on the same channel, and all registered clients will receive the message , being possible to pass parameters in these messages.

    
11.08.2017 / 16:05