Cannot disconnect properly the spice session
Hello,
In a application i'm building, i'm using spice-client library (version 0.35 on debian 10) to connect to a VM. I used the spicy example. I can connect and use the cursor, inputs channel correctly.
But when i disconnect, i don't receive the "disconnected" signal on the session. Then if i try to reconnect, it don't work (the main channel disconnect). Only if i kill and restart my application i can finally connect.
Here is how i do :
spice_session_open_fd (connecting using a socket)
i connect to cursor and inputs channel with : spice_channel_connect
Then later i do : spice_session_disconnect
I listen to "channel-destroy" signals, so i can set my variables cusor, inputs, main channel to NULL, when they are destroyed.
I listen to "disconnected" signal to destroy the connection variable : unref conn->session and free(conn) like in spicy
=> But this signal never happen
I listed all the channels of my sessions, other channels are display and webdav. I dont connect to them.
Here is the last log i have (spice debug log) :
(wt-streamer:18249): GSpice-DEBUG: 10:18:52.934: spice-session.c:2311 main-1:0: the session lost the main channel
(wt-streamer:18249): GSpice-DEBUG: 10:18:52.934: spice-channel.c:2880 main-1:0: channel disconnect 0
(wt-streamer:18249): GSpice-DEBUG: 10:18:52.934: spice-channel.c:2670 main-1:0: Coroutine exit main-1:0
(wt-streamer:18249): GSpice-DEBUG: 10:18:52.934: spice-channel.c:2863 main-1:0: reset
(wt-streamer:18249): GSpice-DEBUG: 10:18:52.934: channel-main.c:1552 agent connected: no
(wt-streamer:18249): GSpice-DEBUG: 10:18:52.934: spice-session.c:1765 no migration in progress
Am i missing something ?
Thanks for your help !