Asynchronous Operations

When RasDial is invoked as an asynchronous operation, the function returns immediately. In asynchronous mode, the RasDial call must specify a notification handler that RAS uses to inform the client application when the connection operation state changes or an error occurs.

RAS makes its asynchronous notifications in the context of the thread that made the RasDial call. Therefore, the calling thread must not terminate until the connection is established or an error occurs. As in synchronous mode, the client application can safely terminate when the connection is established, and it must close the connection if an error occurs.