Process events when destroying CoreNetwork
[quassel.git] / src / core / corenetwork.h
index 51eb31a..5a41b98 100644 (file)
@@ -127,6 +127,17 @@ public slots:
     void disconnectFromIrc(bool requested = true, const QString &reason = QString(),
                            bool withReconnect = false, bool forceImmediate = false);
 
+    /**
+     * Forcibly close the IRC server socket, waiting for it to close.
+     *
+     * Call CoreNetwork::disconnectFromIrc() first, allow the event loop to run, then if you need to
+     * be sure the network's disconencted (e.g. clean-up), call this.
+     *
+     * @param msecs  Maximum time to wait for socket to close, in milliseconds.
+     * @return True if socket closes successfully; false if error occurs or timeout reached
+     */
+    bool forceDisconnect(int msecs = 1000);
+
     void userInput(BufferInfo bufferInfo, QString msg);
 
     /**