Synchronous mode provides a simple way for a client to establish a connection. When RasDial is invoked as a synchronous operation, the function does not return until the connection is established or an error occurs. The client application can call RasDial, wait for the function to return, and then call the RasGetConnectStatus function to determine if the connection operation was successful. When the connection is established, the client application can terminate without closing the connection. If an error occurs, it must close the connection before terminating.
The disadvantage of synchronous mode is that the client does not receive progress notifications of the current connection operation state. As an alternative, a synchronous-mode client application can use a separate thread that calls RasGetConnectStatus to poll for and display the current state. However, for client applications that require progress data, the preferred technique is to invoke RasDial asynchronously.