// Upload the next chunk to the server. void WiredTransferSocket::sendNextFileChunk(qint64 theOffset) { const int tmpChunkSize = 4096 * 8; // 4096 is the page size on x86 - a good value for buffer sizes if( pSendingFile && pTransfer.pTransferType==1 ) { qDebug() << "Sending"<atEnd()) { // Done! pFile->seek(pTransfer.pOffset); qDebug() << "Sending"<pos(); QByteArray tmpData = pFile->read(tmpChunkSize); pTransfer.pOffset += pSocket->write(tmpData); if(pTransfer.pOffset == FILESIZE) { qDebug() << "We are done. Close."; pSocket->disconnectFromHost(); } } } }