Monitoring Dial-up connection stages: Tutorial

This tutorial describes how an application can monitor the stages of a dial-up connection.

This tutorial has two parts. The first part describes how the application can ask for the current state of a dial-up connection. The second part describes how the application can be notified of changes in the state of a dial-up connection.

How to ask for the current state of a dial-up connection

To ask for the current state of a dial-up connection, an application calls the RConnection::Progress() function passing in a TNifProgress object. On return, the iStage data member of the TNifProgress object contains the information that defines the current state of the connection.

How to be notified of changes in the state of a dial-up connection

The request that the application makes is an asynchronous request. An asynchronous request is not guaranteed to complete at the time of the return of the function call.

To make the request, an application calls the RConnection::ProgressNotification() function.

The function takes a TRequestStatus object, as is the model with asynchronous requests, and the TNifProgressBuf package buffer which packages a TNifProgress object.

When the request completes, the iStage data member of the TNifProgress object contains the information defining the current state of the connection.

An outstanding request for notification can be cancelled using the RConnection::CancelProgressNotification() member function of RConnection.

We recommend that an application package this functionality as an active object.