Posted on 2001-07-24
I wrote a program that needs a connection to the internet to download some files in order to work properly. The program periodically attempts to download the files opening a stream to the server using url.openStream(), if an exception occur, the program waits a period of time and then attempts again the connection.
I don't understand why it is behaving different depending on whether the dial-up connection is stablished or not. If the connection is stablished before the program runs, everithing goes right, but if the program runs before the connection is stablished(at least 1 failed attempt was made for downloading the files) the url.openStream() always thows an exception no matters if the connection is available later on.
It seems to be like it "remembers" that the connection was unavailable and the next time it tries to download the files a real attempt is not made.
Maybe something is happening with the ip address, because it is assigned dinamically by the ISP and in the first case the ip address exists but in the second not until the connection is stablished.
Please, i need a solution as soon as possible.
Diego Broos V.