// Upload the next chunk to the server. void WiredTransferSocket::sendNextFileChunk(qint64 theOffset) { const int tmpChunkSize = 32000; if( pSendingFile && pTransfer.pTransferType==1 ) { qDebug() << "Sending"<atEnd()) { // Done! pFile->seek(pTransfer.pOffset); qDebug() << "Sending"<pos(); QByteArray tmpData = pFile->read(tmpChunkSize); pSocket->write(tmpData); if(pFile->atEnd()) { qDebug() << "We are done. Close."; pSocket->disconnectFromHost(); } } } }