File transfer + thread?

Hi all,

I’'ve managed to monitor incomoming file transfer (as described in the code snippet of http://www.jivesoftware.org/community/thread.jspa?threadID=21159&tstart=0 post) and it works.

But when I monitor the transfer using the loop (while(!ift.isDone)…), it seems to use a forground thread which takes the hand over all the other threads of the application.

Then I wonder if there’'s a way to monitor incoming (and outgoing) file transfer in background (to avoid to freeze the rest of the application during transfer)??

Thanks for your help!

JTecks.

The example in that thread uses Thread.sleep() so it shouldn’'t hog the CPU…

An example:

public void run() {

while (true) {

if (m_transfer.isDone()) {

// do something

return;

}

else {

// monitor status

}

try {

Thread.sleep(100);

}

catch (InterruptedException ie) {}

}

}

Hey Nojo,

Thx for your reply…

But I’'ve fixed my problem:

It came from thread management with SWT I use for my GUI.

I now manage to monitor cleanly an incoming file transfer without any thread side effects…

NB: SWT is very powerful and clean for GUI layer…I really suggest to use it instead of awt/swing!!

thx for your concern…

JTecks.