[Delta] Iris questions (was: Re: trying to make a code like justins code (jabber example) but i have errors)
stormway at gmail.com
Mon Mar 24 18:49:48 PDT 2008
thanks man really thanks
i will try it out and get back to you :)
your explanation is pretty amazing
On Mon, Mar 24, 2008 at 6:01 PM, Justin Karneges <justin-psi2 at affinix.com>
> On Monday 24 March 2008 5:12 pm, K. Nimer wrote:
> > i am totally confused and blown off , why did it work now ?
> > thanks man but what is this ,
> > i am soo lost , qt is powerful
> > u know when you say your an expert in c++ but a kid in QT , well i am
> > thats definitly me :S i am really lost
> > is it me , or its because i ddint know what a delayslot is i am not sure
> I wouldn't expect you to know about the Client delayedCloseFinished()
> but what you should know is how the Qt event loop works. I'm guessing
> is your first time using Qt. You are brave. :) Maybe it would be best to
> write some simple GUI app first. Did you do the Qt tutorials?
> > is it also easy to send files that simple?
> Sort of. The setup is not straightforward.
> First, if you want to support P2P connections, then you need to set up an
> // create a server object listening on port 8010
> S5BServer *s5bServer = new s5bServer;
> // tell client to use it
> If you skip this step, then you can only use proxy transfers.
> Next, enable the file transfer feature:
> Now you may use the filetransfer.h API. From here it should be easy to
> understand, but it does take some work to use since Iris does not actually
> read and write files. For example, it is up to you to feed it with file
> to send.
> To send a file:
> // session variables
> FileTransfer *ft;
> int total;
> QByteArray fileData;
> // create file transfer object for sending
> ft = client->fileTransferManager()->createTransfer();
> // listen to some signals
> connect(ft, SIGNAL(connected()), SLOT(ft_connected()));
> connect(ft, SIGNAL(bytesWritten(int)), SLOT(ft_bytesWritten(int)));
> // initialize and send the file
> total = 0;
> fileData = "Hello World\n";
> ft->setProxy("proxy.jabber.org"); // optional, use a proxy
> ft->sendFile(jid, "hello.txt", fileData.size(), "a cool file for you");
> // p2p stream established, now we may send file data
> void ft_connected()
> // some number of bytes have been sent
> void ft_bytesWritten(int bytes)
> total += bytes;
> // all data sent?
> if(total == fileData.size())
> // done
> You should probably listen for other signals too, like accepted() (this
> the other person has accepted the file, but the p2p stream is not yet
> established) and error() (means the user rejected, or there was some
> problem during transfer).
> Delta mailing list
> Delta at lists.affinix.com
Bachelor of Computer Science (ECP)
Option: Software Systems
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Delta