wocky-heartbeat-source

## wocky-heartbeat-source wocky-heartbeat-source |

## Synopsis

    void                (*WockyHeartbeatCallback)           (gpointer user_data);
    GSource *           wocky_heartbeat_source_new          (guint max_interval);
    void                wocky_heartbeat_source_update_interval
                                                            (GSource *source,
                                                             guint max_interval);

## Description

## Details

### WockyHeartbeatCallback ()

    void                (*WockyHeartbeatCallback)           (gpointer user_data);

`user_data` : |

### wocky_heartbeat_source_new ()

    GSource *           wocky_heartbeat_source_new          (guint max_interval);

Creates a source which calls its callback at least every `max_interval` seconds. This is similar to `g_timeout_source_new_seconds()`, except that the callback may be called slightly earlier than requested, in sync with other periodic network activity (from other XMPP connections, or other applications entirely).

When calling `g_source_set_callback()` on this source, the supplied callback's signature should match WockyHeartbeatCallback.

`max_interval` : | the maximum interval between calls to the source's callback, in seconds. Pass 0 to prevent the callback being called.
Returns : | the newly-created source.

### wocky_heartbeat_source_update_interval ()

    void                wocky_heartbeat_source_update_interval
                                                            (GSource *source,
                                                             guint max_interval);

Updates the interval between calls to `source`'s callback. The new interval may not take effect until after the next call to the callback.

`source` : | a source returned by `wocky_heartbeat_source_new()`
`max_interval` : | the new maximum interval between calls to the source's callback, in seconds. Pass 0 to stop the callback being called.