 |
Author |
Topic: how to know when loading from network is complete? (Read 494 times) |
|
sspboyd
|
how to know when loading from network is complete?
« on: Sep 23rd, 2004, 3:50am » |
|
I am working on a proof of concept app that reads a perl file off the web into an array and looks through it for updated info. Is there a way of being able to tell when a file has completed downloading from a server? Eg. assuming it could take 1 second for a request to be sent and info recieved back, that's a lot of cycles through loop().
|
« Last Edit: Sep 23rd, 2004, 8:31pm by sspboyd » |
|
gmail.com w/ sspboyd username
|
|
|
cello
|
Re: how to know when loading info from url is done
« Reply #1 on: Sep 23rd, 2004, 5:49am » |
|
As far as I can tell, the load functions are blocking. IE, your app will freeze until the file finishes downloading. Marcello
|
|
|
|
sspboyd
|
Re: how to know when loading from network is compl
« Reply #2 on: Sep 24th, 2004, 2:22am » |
|
perhaps threading is the answer then?
|
gmail.com w/ sspboyd username
|
|
|
fry
|
Re: how to know when loading from network is compl
« Reply #3 on: Sep 24th, 2004, 7:02am » |
|
yup, put it in a thread that takes care of the network io. there's a new set of classes in java 1.4 with non-block net io, but you may as well stick with the older 1.1 stuff and use a thread. it's not too bad.
|
|
|
|
|