Em Sunday, 5 de June de 2011, às 13:06:07, tushar mehta escreveu: > Hi all, > > I am currently trying to understand how kde applications uses kio > for doing file related operations. I am currently working on kget and > as part of my summer of code project task I need to figure out how > we can have speed limit on transfer using kio protocols like http/ftp. > > Do have we have any sample examples or documentation related > to KIO?
I don't think there's any documentation on that. Just read the source code, starting at KIO::Connection. But to simplify what you're looking for: kioslaves use blocking methods. They read from the network one chunk of data and then they send that chunk of data to the application (via KIO::Connection). The application also uses KIO::Connection to read that chunk of data. When the ioslave fills up the kernel transfer buffer, KIO::Connection will block, waiting for the application to read from the same buffer. In order to implement a rate control in the ioslave, you simply need to implement a rate control in the application. After the stabilisation phase, the ioslave will download at the same rate that the application reads from the slave. -- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Senior Product Manager - Nokia, Qt Development Frameworks PGP/GPG: 0x6EF45358; fingerprint: E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
signature.asc
Description: This is a digitally signed message part.
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<