Version: (using KDE KDE 3.2.3) Installed from: Debian testing/unstable Packages Instead of shuting down a dcop-client could try to reconnect to a new upcoming dcopserver. This can be done by implementing a slot like reAttch() shown below, which is then called on Error in DCOPClient::processSocketData(int fd). Of course it makes no big sense if dcopserver isn't respawned automatically. In my special case I've put the dcopserver with option --nofork for respawn into /etc/inittab, because I'll never have anything else than DISPLAY=:0 (specialiced production environment). void DCOPClient::reAttach() { static QTimer *timer = NULL; static QCString appId; if (timer == NULL) { // first call after connection brake down // first we'll create a new timer for subsequent retries timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(reAttach()) ); timer->start(2000, false); // 2 seconds periodic timer appId = d->appId; // remember how we were called before we'll // destroy it. } // now trying to put connection down clean, most code taken from // destructor and constructor detach(); d->iceConn = 0L; if (d->registered) unregisterLocalClient(d->appId); delete d->notifier; delete d->transactionList; delete d; if (mainClient() == this) setMainClient(0); d = new DCOPClientPrivate; d->parent = this; d->iceConn = 0L; d->majorOpcode = 0; d->key = 0; d->currentKey = 0; d->appId = 0; d->notifier = 0L; d->non_blocking_call_lock = false; d->registered = false; d->foreign_server = true; d->accept_calls = true; d->accept_calls_override = false; d->qt_bridge_enabled = true; d->transactionList = 0L; d->transactionId = 0; // Static pointer is not touched by destrutor or constructor, but we // need to get the new servers address. d->serverAddr = 0L; QObject::connect( &d->postMessageTimer, SIGNAL( timeout() ), this, SLOT( processPostedMessagesInternal() ) ); qWarning("Trying to reconnect to dcopserver."); if ( !mainClient() ) setMainClient( this ); extern int _kde_IceLastMajorOpcode; // from libICE _kde_IceLastMajorOpcode = 0; attachInternal(false); if (isAttached()) { registerAs(appId, false); qWarning("Now we're attached to dcopserver: %s", d->serverAddr ? d->serverAddr : "NULL"); delete timer; timer = NULL; } }
Closing as DCOP is unmaintained.