Index: libs/libmythtv/remoteutil.cpp
===================================================================
--- libs/libmythtv/remoteutil.cpp	(revision 8406)
+++ libs/libmythtv/remoteutil.cpp	(working copy)
@@ -351,7 +351,7 @@
 {
     QStringList strlist = "QUERY_ISRECORDING";
 
-    if (!gContext->SendReceiveStringList(strlist))
+    if (!gContext->SendReceiveStringList(strlist, false, false))
         return -1;
 
     return strlist[0].toInt();
Index: libs/libmyth/mythcontext.h
===================================================================
--- libs/libmyth/mythcontext.h	(revision 8406)
+++ libs/libmyth/mythcontext.h	(working copy)
@@ -359,7 +361,8 @@
     QPixmap *LoadScalePixmap(QString filename, bool fromcache = true); 
     QImage *LoadScaleImage(QString filename, bool fromcache = true);
 
-    bool SendReceiveStringList(QStringList &strlist, bool quickTimeout = false);
+    bool SendReceiveStringList(QStringList &strlist, bool quickTimeout = false, 
+                               bool block = true);
 
     QImage *CacheRemotePixmap(const QString &url, bool reCache = false);
 
Index: libs/libmyth/mythcontext.cpp
===================================================================
--- libs/libmyth/mythcontext.cpp	(revision 8406)
+++ libs/libmyth/mythcontext.cpp	(working copy)
@@ -204,6 +204,7 @@
     QString m_localhostname;
 
     QMutex serverSockLock;
+    bool attemptingToConnect;
 
     MDBManager m_dbmanager;
     
@@ -263,6 +264,7 @@
       m_baseWidth(800), m_baseHeight(600),
       m_localhostname(QString::null),
       serverSockLock(false),
+      attemptingToConnect(false),
       language(""),
       mainWindow(NULL),
       m_wmult(1.0), m_hmult(1.0),
@@ -860,6 +862,10 @@
             delete serverSock;
             serverSock = NULL;
         
+            if (d->attemptingToConnect)
+                break;
+            d->attemptingToConnect = true;
+
             // only inform the user of a failure if WOL is disabled 
             if (sleepTime <= 0)
             {
@@ -870,6 +876,12 @@
                     "proper IP address.");
                 if (d->m_height && d->m_width)
                 {
+                    bool manageLock = false;
+                    if (!blockingClient && d->serverSockLock.locked())
+                    {
+                        manageLock = true;
+                        d->serverSockLock.unlock();
+                    }
                     MythPopupBox::showOkPopup(d->mainWindow, 
                                               "connection failure",
                                               tr("Could not connect to the "
@@ -877,8 +889,11 @@
                                                  "it running?  Is the IP "
                                                  "address set for it in the "
                                                  "setup program correct?"));
+                    if (manageLock)
+                        d->serverSockLock.lock();
                 }
 
+                d->attemptingToConnect = false;
                 return false;
             }
             else
@@ -897,6 +912,7 @@
                 sleep(sleepTime);
                 ++cnt;
             }
+            d->attemptingToConnect = false;
         }
         else
             break;
@@ -2273,12 +2289,15 @@
     ClearSettingsCache(key, newValue);
 }
 
-bool MythContext::SendReceiveStringList(QStringList &strlist, bool quickTimeout)
+bool MythContext::SendReceiveStringList(QStringList &strlist, bool quickTimeout, bool block)
 {
     d->serverSockLock.lock();
     
     if (!d->serverSock)
+    {
         ConnectToMasterServer(false);
+        // should clear popup if it is currently active here. Not sure of the correct way. TBD
+    }
 
     bool ok = false;
     
@@ -2312,7 +2331,12 @@
 
         if (!ok)
         {
+            delete d->serverSock;
+            d->serverSock = NULL;
+
             qApp->lock();
+            if (!block)
+                d->serverSockLock.unlock();
             VERBOSE(VB_ALL, QString("Reconnection to backend server failed"));
             if (d->m_height && d->m_width)
                 MythPopupBox::showOkPopup(d->mainWindow, "connection failure",
@@ -2320,8 +2344,8 @@
                                 "server has gone away for some reason.. "
                                 "Is it running?"));
 
-            delete d->serverSock;
-            d->serverSock = NULL;
+            if (!block)
+                d->serverSockLock.lock();
             qApp->unlock();
         }
     }    
