bool HttpServerResponse::flush()
{
    QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(&priv->device);
    if (!socket)
        return false;

    return socket->flush();
}
Beispiel #2
0
qint64 Worker::writeAndFlush(QIODevice* device, const char* buf, int size)
{
	if (device) {
		qint64 res = device->write(buf, size);
		QAbstractSocket* sock = qobject_cast<QAbstractSocket*>(device);
		if (sock) {
			sock->flush();
		}

		return res;
	}

	return -1;
}
void TQIODeviceTransport::flush()
{
  if (!dev_->isOpen()) {
    throw TTransportException(TTransportException::NOT_OPEN,
                              "flush(): underlying QIODevice is not open");
  }

  QAbstractSocket* socket;

  if ((socket = qobject_cast<QAbstractSocket*>(dev_.get()))) {
    socket->flush();
  } else {
    dev_->waitForBytesWritten(1);
  }
}