If the client session is valid and connected to a server, the
method returns a non-zero value. If the client is not connected,
the method returns zero. To get extended error information,
call GetLastError.
The IsConnected method determines whether there is a
logical connection to the service provider and the client has
successfully authenticated with the API server. Calling this method
is not simply a passive status check. The network connection to the
provider may be transient and can be automatically re-established
if the client session has been idle. Calling IsConnected
may cause the library to reconnect and re-authenticate with the
server if necessary.
If the client must re-authenticate, it will attempt to reconnect
to the server and validate the selected model for the session. If
the server reports an error condition, such as an invalid API key,
the connection will not be re-established and the method will
return zero.