Touring AreasTour Areas: [1] Minimal Source Code Instrumentation

[5. Running the Logging Server ]
[6. View Data, Live and Recorded]
[7. The Data ]
[8. Reviewing Data ]
[9. The Documentation]

[2] Establishing Communications with the Logging Server

The application must establish a communications link with the DTraq logging server. Over this link will be transmitted the raw bytes of each data item as it is tapped. The logging server also broadcasts commands back to connected clients regarding which tapped items are to be enabled and disabled.

The package DTraq.Client_Transport provides a pair of procedures, one to connect to the logging server, and one to disconnect from it. These are Connect_To_Server and Disconnect_From_Server.

Connect_To_Server provides a number of parameters to configure the application's connection to the logging server. Default values are provided for all of them, although the Host and Port parameters will most likely require explicit arguments in real-word applications. However, for simple single machine applications where the logging server and the application can both be resident on the same machine (and for when just trying DTraq out), using the default arguments should be sufficient.


Disconnect_From_Server has no parameters and does nothing more than cleanly break the communication link to the logging server.


Connect_To_Server should obviously be invoked at some point during the application's initialization activities, since no data items will be tapped and logged until that link is established. Disconnect_From_Server is then best called as part of the application's cleanup and termination.


Next: Compiling the Tapped Application


©2006 McKae Technologies