Inner realization of DelphiXE7 Datasnap Tdsclientcallbackchannelmanager

Source: Internet
Author: User

The callback principle is simple, open a thread (in order to distinguish the other threads, this thread named "Channel Thread"), register a "lightweight" callback, and then this thread (channel thread) and other server return information (callback), the server has information returned, the channel thread then open a thread to execute the user registration callback ( Tdbxcallback) of the Execute method. The channel thread returns the callback information for the server that continues to wait.

Tdsclientcallbackchannelmanager.broadcast

Tdsclientcallbackchannelmanager.notifycallback

These two methods can send information to other clients through the server, and the Notifycallback method can receive the reply information from other clients. Both methods establish a new connection to the server when sending the message (which can be monitored at the server). Immediately after sending the message, disconnect. Frequent delivery may have an impact on the service program. When the program exits, it will connect again, disconnect 2-3 times, perform some finishing operations, such as logout channel.

Tdsclientcallbackchannelmanager registered callbacks, which are called "Heavyweight" callbacks on the demo or document. (In the demo before XE7, it seems to be the whole other demo)

When we need to communicate or broadcast messages to other clients, it is best to include a method in the service program, called by the client program to implement the broadcast of the message, rather than through Tdsclientcallbackchannelmanager.

XE7 's demo takes this approach. This reduces the number of connection disconnects to the service program and increases the performance of the server.

Inner realization of DelphiXE7 Datasnap Tdsclientcallbackchannelmanager

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.