DataSnap.EchoToChannel Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample shows how to use a DataSnap/DBX TCPIP connection.


You can find the EchoToChannel sample project at:


The Echo to Channel sample contains two projects:

  • The client sample demonstrates how to listen for messages from a callback channel using a DataSnap/DBX TCPIP connection.
  • The server demonstrates how to implement a server method that broadcasts a message to a channel.

How to Use the Sample

Navigate to Start | Programs | Embarcadero RAD Studio Rio | Samples and go to Object Pascal\DataSnap\EchoToChannel. There are two projects in the EchoToChannel directory:

EchoToChannel Server Project

  1. Open the EchoToChannelServerProject.dproj project.
  2. Build the EchoToChannelServerProject.dproj project.
  3. Run the application by clicking Run > Run in the IDE or by pressing F9.
  4. This opens an Echo to Channel server interface.
  5. Follow the EchoToChannel Client Project instructions to start one or more clients.

EchoToChannel Client Project

  1. Open the DBXEchoToChannelClientProject.dproj project.
  2. Build the DBXEchoToChannelClientProject.dproj project.
  3. Run the application by clicking Run > Run in the IDE or by pressing F9.
  4. The client application enables you to listen to a channel and call the server method class.


The files used by this sample are:

EchoToChannel Server Files

File Contains


The Echo to Channel server project.


The main form that is the user interface for the Echo to Channel server sample.


The server methods container holding source code for the server methods used in the Echo to Channel sample.


The server container that holds the DataSnap Server components.

EchoToChannel Client Files

File Contains


The Echo to Channel client project.


Client classes created by the DataSnap proxy generator.


The main form that is the user interface for the Basic DataSnap Client application.


The Echo to Channel server module.


  • TClientModule1 implements the Echo to Channel client module.
  • TServerMethods1Client implements the server methods available for the Echo to Channel client sample.
  • TForm4 is the main form that handles all controls.


  • A TSQLConnection object provides the DataSnap/DBX TCPIP connection.
  • The client interface has a Connect button to listen from the callback channel and an Echo button to call the server method.


See Also