ECal.Client.connect
Description: Reference for ECal.Client.connect

### Function

# ECal Clientconnect

since: 3.8

#### Declaration [src]

    void
    e_cal_client_connect (
      ESource* source,
      ECalClientSourceType source_type,
      guint32 wait_for_connected_seconds,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description [src]

Asynchronously creates a new `ECalClient` for `source` and `source_type`.

The `wait_for_connected_seconds` argument had been added since 3.16, to let the caller decide how long to wait for the backend to fully connect to its (possibly remote) data store. This is required due to a change in the authentication process, which is fully asynchronous and done on the client side, while not every client is supposed to response to authentication requests. In case the backend will not connect within the set interval, then it is opened in an offline mode. A special value -1 can be used to not wait for the connected state at all.

Unlike with e_cal_client_new(), there is no need to call `e_client_open()` after obtaining the `ECalClient`.

When the operation is finished, `callback` will be called. You can then call `e_cal_client_connect_finish()` to get the result of the operation.

Available since: 3.8

This function completes asynchronously. Use `e_cal_client_connect_finish()` inside the `GAsyncReadyCallback` to obtain the result of the operation.

#### Parameters

`source`

  Type: `ESource`

  An `ESource`.

  The data is owned by the caller of the function.

`source_type`

  Type: `ECalClientSourceType`

  Source tpe of the calendar.

`wait_for_connected_seconds`

  Type: `guint32`

  Timeout, in seconds, to wait for the backend to be fully connected.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

`callback`

  Type: `GAsyncReadyCallback`

  A `GAsyncReadyCallback` to call when the request is satisfied.

`user_data`

  Type: `gpointer`

  Data to pass to the callback function.

  The argument can be `NULL`.
  The data is owned by the caller of the function.