Connected Callback 3 Libdmapsharing
Connected Callback Defining a Connected Callback

## Connected Callback

Once the DmapConnection object completes its interrogation of a DMAP server, it will emit the "connected" signal. Libdmapsharing has fully populated the DmapConnection's DmapDb by this point. The following is a simple "connected" callback which assumes db had previously been passed as the third argument to dmap_connection_start:

    static void
    connected_cb(DmapConnection *connection, gboolean result, const char *reason, DmapDb *db)
    {
    	g_print ("DB has %lu entries\n", dmap_db_count (db));
    	dmap_db_foreach (db, print_record, NULL);
    	g_main_loop_quit (loop);
    }