From kde-core-devel Sat Oct 27 01:09:04 2001 From: Charles Samuels Date: Sat, 27 Oct 2001 01:09:04 +0000 To: kde-core-devel Subject: Announce: KIO-Sync 0.1.0 X-MARC-Message: https://marc.info/?l=kde-core-devel&m=100414511216951 I'm announcing the release of the synchronous KIO Wrapper. FAQ: Q. You reimplemented all those protocols?! A. No, this uses the same kio slaves on your computer already. Q. Is it threadsafe A. YES! (Kinda). This is different from the normal KIO in that it doesn't require an event loop. Getting data just requires reimplemting virtual functions. This means that you could use KIO in one thread, and UI processing in the main thread. (I could still use slots-n-signals, because they don't use the event loop, because I didn't, they're much slower.) Q. What's all the stuff in the tarball A. "test" is a program that links to libkiosync and accepts two args. the command, and the URL. The commands "cat", "ls", and "stat" are supported, and do (more or less) what the shell tools do. Also is libkiosyms, which allows LD_PRELOADing! For example, the following is supported: LD_PRELOAD=libkiosync.so ls ftp://anonymous:fred%40bob.com:altair.dhs.org/pub/ This uses libkiosync to make the GNU "ls" shell tool able to access KIO. (I've had success with ls, stat, and cat only) Be aware that the libs are in .libs when you try to use this. You may also need LD_LIBRARY_PATH set. I really wouldn't recommend installing libkiosync. And expect lots of debug messages. Q. How complete is the implementation of the KIO protocol? A. About 30%, I think. Redirections don't work, but gets, lists and stats do. No put or copy yet. Q. How complete is this lib in general? A. It could be better, I have a "Select" class, but I don't use it yet. Which means that using one dispatcher for two or more jobs will be slow. I also need to write docs. Q. How fast is it? A. In theory, it should be much faster than KIO for stuff like listing a directory (which sends lots of signals). Benchmark it if you will, but as I said, multiple jobs per dispatcher isn't a keen idea yet. I think KIO's bottleneck is the Qt signals, which are designed for high level things like button presses, not speed critical low level stuff like "A New file available, here is the mimetype data." I have no research to back this up. Q. Show me an example. A. No, look in test.cpp: using namespace KIOS; using namespace KIOS::Job; class GetGet : public TransferJob { public: GetGet(const KURL &url) : TransferJob(url, false) { } void data(const QByteArray &data) { for (uint i=0; i