summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SpiceXPI/src/plugin/controller-unix.cpp2
-rw-r--r--SpiceXPI/src/plugin/controller.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/SpiceXPI/src/plugin/controller-unix.cpp b/SpiceXPI/src/plugin/controller-unix.cpp
index d9bf9a5..83dc59a 100644
--- a/SpiceXPI/src/plugin/controller-unix.cpp
+++ b/SpiceXPI/src/plugin/controller-unix.cpp
@@ -103,6 +103,8 @@ int SpiceControllerUnix::Connect()
int rc = connect(m_client_socket, (struct sockaddr *) &remote, strlen(remote.sun_path) + sizeof(remote.sun_family));
if (rc == -1)
{
+ if (errno == EISCONN)
+ rc = 1;
g_critical("controller connect: %s", g_strerror(errno));
}
else
diff --git a/SpiceXPI/src/plugin/controller.cpp b/SpiceXPI/src/plugin/controller.cpp
index 988768b..bd8b9d7 100644
--- a/SpiceXPI/src/plugin/controller.cpp
+++ b/SpiceXPI/src/plugin/controller.cpp
@@ -94,6 +94,8 @@ int SpiceController::Connect(const int nRetries)
for (int i = 0; rc != 0 && i < nRetries; ++i)
{
rc = Connect();
+ if (rc == 1)
+ break;
g_usleep(sleep_time * G_USEC_PER_SEC);
}
if (rc != 0) {