Posts: 222
Joined: Aug 2011
Reputation:
11
tsp42
Senior Member
Posts: 222
2012-05-06, 22:55
(This post was last modified: 2012-05-06, 22:57 by tsp42.)
I suspect that it is because the connection(socket) to the backend is broken when resuming from standby. Currently there is no code to try reestablishing the connection. The libcmyth code that has to be updated. We/I need to add a new function to update the cmyth_conn_t struct.
Any help will of course be highly appreciated. As you may have discovered it can be quite time consuming to fix all these bugs.
Posts: 38
Joined: Apr 2012
Reputation:
1
InoD
Junior Member
Posts: 38
Ok, I'll have a look at how this is implemented best. Will probably take some time though....
Posts: 838
Joined: Jul 2007
Reputation:
6
@bas.t you need to upgrade libboost to 1.46 or later.
Posts: 38
Joined: Apr 2012
Reputation:
1
InoD
Junior Member
Posts: 38
Support for graceful reconnecting doesn't seem to be very straightforward, at least, not at the level I'd like to have it implemented.
The cmyth library sets conn_hang in the cmyth_conn_t structure, which can be retrieved using the ConnHung function. However, if you want to initiate the reconnecting from XBMC side (MyhTV PVR Client code), then each function communicating with the library should first check the connection (ConnHung) and if hung initiate the reconnecting. That will result in a lot of code, but you will be able to create notifications.
If implemented at the other end, connection.c in the library, then the connection could be reconnected right where and when it is detected to be disconnected. XBMC will not know it has reconnected, also you might run into an infinite reconnecting loop. But, I think the library should be dumb and not do such a thing unless it is requested to do so.
XBMC offers some functionality to detect when waking up from standby, this could be used to force reconnecting (if you know the connection is gone it is faster to reconnect than the wait for the next command to fail), but having a reconnect mechanism will also cover the other use-cases in which the connection could have been closed.
What do you think is the best way to implement this? Do you have other ideas?