[mythtv] [PATCH] Add single retry of connection to master backend

Allan Stirling Dibblahmythml0015 at pendor.org
Wed Jun 15 20:20:12 UTC 2005


Isaac Richards wrote:
> 
> 
> It shouldn't ever happen, but doesn't hurt to leave it in just in case that it 
> does.
> 
New version attached - Only the retry and renaming the obsolete comment 
are included.

Cheers,

Allan.
-------------- next part --------------
Index: libs/libmyth/mythcontext.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythcontext.cpp,v
retrieving revision 1.179
diff -u -r1.179 mythcontext.cpp
--- libs/libmyth/mythcontext.cpp	1 Jun 2005 21:09:54 -0000	1.179
+++ libs/libmyth/mythcontext.cpp	15 Jun 2005 20:16:00 -0000
@@ -2007,7 +2007,15 @@
         WriteStringList(d->serverSock, strlist);
         ok = ReadStringList(d->serverSock, strlist, quickTimeout);
 
-        // this should be obsolete...
+        if (!ok)
+        {
+            VERBOSE(VB_IMPORTANT, QString("Connection to backend server lost"))
+            ConnectToMasterServer();
+            WriteStringList(d->serverSock, strlist);
+            ok = ReadStringList(d->serverSock, strlist, quickTimeout);
+        }
+
+        // this should not happen
         while (ok && strlist[0] == "BACKEND_MESSAGE")
         {
             // oops, not for us
@@ -2025,7 +2033,7 @@
         if (!ok)
         {
             qApp->lock();
-            VERBOSE(VB_ALL, QString("Connection to backend server lost"));
+            VERBOSE(VB_ALL, QString("Reconnection to backend server failed"));
             MythPopupBox::showOkPopup(d->mainWindow, "connection failure",
                              tr("The connection to the master backend "
                                 "server has gone away for some reason.. "


More information about the mythtv-dev mailing list