void Gosu::CommSocket::disconnect() { pimpl->socket.setHandle(INVALID_SOCKET); // IMPR: Mmmmh. A full-blown sockets library should probably try to send // the remaining contents of the outbox. This is annoying to implement, // though... pimpl->outbox.clear(); if (onDisconnection) onDisconnection(); }
void Lvk::FE::ConnectionWidget::setAppFacade(BE::AppFacade *appFacade) { m_appFacade = appFacade; if (m_appFacade) { connect(m_appFacade, SIGNAL(connected()), SLOT(onConnectionOk())); connect(m_appFacade, SIGNAL(disconnected()), SLOT(onDisconnection())); connect(m_appFacade, SIGNAL(connectionError(int)), SLOT(onConnectionError(int))); } ui->verifactionWidget->setAppFacade(appFacade); }
void TCPClient::close() { { lock_guard<recursive_mutex> lock(_mutex); if (!_connected) return; _connected = false; if (!_disconnecting) { Exception ex; _socket.shutdown(ex); } else _disconnecting = false; _socket.close(); _rest = 0; _pBuffer.release(); _address.reset(); _peerAddress.reset(); } onDisconnection(); // in last because can call a TCPClient::connect, or delete this }
void DBusInputContextConnection::newConnection(const QDBusConnection &connection) { ComMeegoInputmethodInputcontext1Interface *proxy = new ComMeegoInputmethodInputcontext1Interface(QString(), QString::fromLatin1(DBusClientPath), connection, this); static unsigned int connectionCounter = 1; // Start at 1 so 0 can be used as a sentinel value unsigned int connectionNumber = connectionCounter++; mConnectionNumbers.insert(connection.name(), connectionNumber); mProxys.insert(connectionNumber, proxy); mConnections.insert(connectionNumber, connection.name()); QDBusConnection c(connection); c.connect(QString(), QString::fromLatin1(DBusLocalPath), QString::fromLatin1(DBusLocalInterface), QString::fromLatin1(DisconnectedSignal), this, SLOT(onDisconnection())); c.registerObject(QString::fromLatin1(DBusPath), this); proxy->setLanguage(lastLanguage); }
void Lvk::FE::ConnectionWidget::connectBlockedForUpdate(const DAS::UpdateInfo &info) { onDisconnection(); emit blockedForUpdate(info); }