[yast-commit] r55350 - /trunk/core/dbus/SCR_service/DBusServer.cc
Author: kkaempf Date: Mon Feb 9 13:59:36 2009 New Revision: 55350 URL: http://svn.opensuse.org/viewcvs/yast?rev=55350&view=rev Log: relate connection timeout to idle alarm Modified: trunk/core/dbus/SCR_service/DBusServer.cc Modified: trunk/core/dbus/SCR_service/DBusServer.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/dbus/SCR_service/DBusServer.cc?rev=55350&r1=55349&r2=55350&view=diff ============================================================================== --- trunk/core/dbus/SCR_service/DBusServer.cc (original) +++ trunk/core/dbus/SCR_service/DBusServer.cc Mon Feb 9 13:59:36 2009 @@ -16,7 +16,7 @@ #include "scr_names.h" -#define TIMEOUT 15000 /* 15 seconds */ +#define TIMEOUT 15 /* 30 secs idle timeout */ extern "C" { @@ -54,10 +54,10 @@ return connection.connect(DBUS_BUS_SYSTEM, YAST_SCR_SERVICE); } -// set 30 second timer +// set idle timer void DBusServer::resetTimer() { - ::alarm(30); + ::alarm(TIMEOUT); } // NOTE: this is a signal handler, do only really necessary tasks here! @@ -138,7 +138,7 @@ // the time is over if (finish) { - y2milestone("Timout signal received"); + y2milestone("Timeout signal received"); if (canFinish()) { @@ -160,7 +160,8 @@ // check if a message was received if (request.empty()) { - connection.setTimeout(TIMEOUT); + /* run the mainloop only on message or after(!) reaching the idle timeout */ + connection.setTimeout((TIMEOUT+1)*1000); /* returns on message or timeout */ continue; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kkaempf@svn.opensuse.org