Glossary Item Box
The decision of whether to use synchronous or asynchronous methods can be crucial and have an impact on the complexity of your code and the user experience.
The following lists discuss some of the characteristics of synchronous and asynchronous methods in PowerTCP.
Synchronous Methods
Asynchronous Methods
Most applications written with PowerTCP will be synchronous. The reasons for this are not purely due to the ease-of-use of synchronous methods. Synchronous methods are ideal for automated processes that can execute a blocking method for a long period of time. In addition, synchronous methods can work well for interactive applications. The Object.DoEvents property controls the processing of user interface messages while a synchronous method is executing. This means that while a synchronous method is executing, other portions of the application will be able to respond to events (for example, button or menu clicks).
Asynchronous methods, on the other hand, provide a great deal of power. When an asynchronous method is called, the method will execute on a thread separate from the calling thread. Such operation is useful when an action is time consuming and other code needs to execute without waiting for the initial operation to complete. In addition, the user interface will be most responsive when asynchronous methods are used.
Send comments on this topic.
Documentation version 1.1.2.0.
© 2008 Dart Communications. All rights reserved.