Camel.Service.connect

### Method

# Camel Serviceconnect

since: 3.6

#### Declaration [src]

    void
    camel_service_connect (
      CamelService* service,
      gint io_priority,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description [src]

Asynchronously connects `service` to a remote server using the information in its `CamelService:settings` instance.

If a connect operation is already in progress when this function is called, its results will be reflected in this connect operation.

If any disconnect operations are in progress when this function is called, they will be cancelled.

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

Available since: 3.6

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

#### Parameters

`io_priority`

  Type: `gint`

  The I/O priority of the request.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

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

`callback`

  Type: `GAsyncReadyCallback`

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

  The argument can be `NULL`.

`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 method.