GIOStream *vdagent_socket_connect(const gchar *path, GError **err)
{
    GSocketConnection *conn;
    GSocketAddress *addr;
    GSocketClient *client;

    addr = g_unix_socket_address_new(path);
    client = g_object_new(G_TYPE_SOCKET_CLIENT,
                          "family", G_SOCKET_FAMILY_UNIX,
                          "type", G_SOCKET_TYPE_STREAM,
                          NULL);
    conn = g_socket_client_connect(client, G_SOCKET_CONNECTABLE(addr), NULL, err);
    g_object_unref(client);
    g_object_unref(addr);
    return G_IO_STREAM(conn);
}
GIOStream *vdagent_socket_connect(const gchar *path, GError **err)
{
    GSocketConnection *conn;
    GSocketAddress *addr;
    GSocketClient *client;

    addr = g_unix_socket_address_new(path);
    client = g_object_new(G_TYPE_SOCKET_CLIENT,
                          "family", G_SOCKET_FAMILY_UNIX,
                          "type", G_SOCKET_TYPE_STREAM,
                          NULL);
    conn = g_socket_client_connect(client, G_SOCKET_CONNECTABLE(addr), NULL, err);
    g_object_unref(client);
    g_object_unref(addr);
    return G_IO_STREAM(conn);
}