Delphi Labs: DataSnap XE - Callbacks

Posted by on in Blogs
I was always intrigued by a possibility of doing callbacks in client/server, distributed applications. RAD Studio XE demos include "CallbackChannels" demo that shows how to use callbacks with different DataSnap communication protocols (TCP/IP, HTTP) and architectures (DBX, REST).

In this "Delphi Labs" episode I have tried to create the most simple example of using callbacks. Both client and server are Delphi VCL Forms applications. To keep it simple I'm only using TCP/IP and DBX. This tutorial covers broadcasting to a channel and notifying a specific callback.

Delphi Labs: DataSnap XE - Callbacks

About
Gold User, Rank: 9, Points: 364
Crazy about Delphi Programming!

Comments

  • Julio Figueiredo
    Julio Figueiredo Thursday, 22 September 2016

    Paweł Głowacki, this same code works in Berlin? I run the code works for broadcast, but notify give an error! Can you see if is this code works correctly?

  • Guest
    Navid Tuesday, 03 April 2012

    Thanks for this,

    would it be possible to have callbackChannels when the client is a Firemonke application (iPhone)?

    Cheers,

  • Guest
    Eli Neria Monday, 07 May 2012

    Thanks for all your Videos
    I want to start with learning data snap and use it in my applications.
    where can i find all your videos on it to grab them and learn this fantastic issue.

    Thank you in advance.
    Eli

  • Guest
    Dobrin Petkov Thursday, 10 May 2012

    Hi Pawel,


    I learned many things from your very useful post. Thanks a lot - you are great as always.
    Is there any news on what exactly means "UseGlobalKey=true" and what if "UseGlobalKey=false"? (transport filters - RSA properties)
    If you’re busy - can you tell me the contacts for more details and or questions?


    Best regards
    Dobrin Petkov

  • Guest
    Freddie Bell Wednesday, 17 April 2013

    I'd like to suggest a 4th part, which is initiating the message send from the server. Your series only shows how to program call-backs from the clients to each other, which is good, but I want for example, say the server admin wants to shut down the server, they can send a "Please finish what you're doing, server is going down in 5 minutes!" message to all clients from the server. Of course, once we can see how this is done, other kinds of callbacks initiated by the server will also be seen. Thanks for all your hard work. I have learned a lot.
    Freddie

  • Guest
    Pawel Glowacki Wednesday, 17 April 2013

    @Freddie,
    Please have a look at Chat demo that comes with Delphi and is typically installed here: "C:\Users\Public\Documents\RAD Studio\10.0\Samples\Delphi\DataSnap\ChatRoomDemo".
    In essence you need to call "Broadcast*" or "Notify*" methods on the DSServer component.
    I hope it helps,
    Pawel

  • Guest

    [...] 集11:回调- – - – - -视频1, 视频2, 视频3, 白皮书, 源代码 [...]

  • Please login first in order for you to submit comments
  • Page :
  • 1