ConnectionStatus Property

This property represents the current status of the mobile application connection, one of the ConnectionStatus class values.

Syntax

public int ConnectionStatus { get; set; }

Returns

ConnectionStatus has the following possible values:

  • ConnectionStatus.CONNECTED – The connection has been successfully started.
  • ConnectionStatus.CONNECTING – The connection is currently being started.
  • ConnectionStatus.CONNECTION_ERROR – The connection could not be started, or was previously started and subsequently an error occurred. Use onConnectionStatusChanged to capture the associated errorCode and errorMessage.
  • ConnectionStatus.DISCONNECTED – The connection been sucessfully stopped, or there was no previous connection.
  • ConnectionStatus.DISCONNECTING – The connection is currently being stopped.
  • ConnectionStatus.NOTIFICATION_WAIT – The connection has been suspended and is awaiting a notification from the server. This is a normal situation for those platforms which can keep connections closed when there is no activity, since the server can reawaken the connection as needed with a notification.

Examples

  • Get the Status
    if (app.ConnectionStatus != ConnectionStatus.CONNECTED)
    {
      // start the connection to server
      app.StartConnection(100);
    }