Connection States

During the process of a client connecting to a remote access server, the client performs several actions to establish the connection. Each step is identified by a connection state. The RASCONNSTATE structure is a set of values that correspond to these connection states. The connection states can be divided into three groups:

Running states are connection operations RAS handles automatically such as connecting to a device and authentication. Unless an error occurs, no action is required of the client other than to pass notification to a user.

Paused states occur when the remote access server pauses the connection operation to get additional user input. During a paused state, a user can type a number, a different user name and password if the user authentication fails, or a new password if the old one has expired.

Terminal states occur when the connection is successfully established, the connection operation fails, or the connection is closed by a call to the RasHangUp function.

There are several mechanisms a client can use to determine the current state of a connection operation. When a client application calls the RasDial function asynchronously, RAS sends progress notifications to the client notification handler when the connection state changes. In addition, the client can use the RasGetConnectStatus function to get the current state of any RAS connection operation.