Synchronous vs Asynchronous Use
The design of the Validator Component permits the use of synchronous or asynchronous communications. For synchronous (blocking) use, call Validate. For asynchronous (non-blocking) use, call BeginValidate.
The following discusses the characteristics of synchronous and asynchronous methods in PowerTCP:
Synchronous Methods
- Are simplest to implement and use compared to asynchronous methods.
- Do not require that an event handler be implemented.
- Return results directly from the method call.
- Throw an explicit Exception to indicate a failure during the method call.
- Call DoEvents() while blocking, so the UI thread is normally not affected.
- Are preferred for use in non-UI environments like ASP.NET and system services.
- Do not raise any events pertaining to the request in operation.
- Preclude the possibility of having 2 synchronous methods in operation at the same time.
Asynchronous Methods
- Work on an IO completion thread, so your UI responsiveness is normally not affected.
- Required that you implement an event to handle the response.
- Provide results that are returned to the event handler.
- Allow for multiple simultaneous outstanding requests.
- Report Exceptions to the event handler (as they are not explicitly thrown).
In This Section
- Overview
- This topic provides an overview for using PowerTCP Email Validation for .NET.
-
- Placing Components on a Form
- This topic demonstrates how to create and use components using Visual Studio .NET.
-
- Creating Components Dynamically
- This topic demonstrates how to add a component as a reference using Visual Studio .NET.
-
- Synchronous vs. Asynchronous Use
- This topic discusses the benefits and uses for synchronous and asynchronous methods.
-
- Using Events
- This topic discusses how to use events with the component, both using Visual Studio .NET and in other environments.
-
Send comments on this topic.
Documentation version 1.0.3.0.
© 2008 Dart Communications. All rights reserved.