Guy,
I'm trying to open a URL and the good news that I can open it then read the data line by line. the data changes every second so i have to read it in an infinite loop. By other words, load the URL then read it line by line, again and again.
the problem the loop stops but no error msgs, memory is not full and there is nothing taking 100% of the CPU !
The while loop code as follow:
while(true){
//the code to load the URL
System.out.prin tln("Start");
while(true){
System.out.prin tln("Check 1");
if((stringLine = myDataInputStre am.readLine()) == null) break;
System.out.prin tln("Check 2");
System.out.prin tln(stringLine) ;
}
System.out.prin tln("End");
}
After 3-4 hours of running the code print Check1 and stops, i does not terminate, just stops without giving any messages!
It do print some of the URL data lines before this happens, it mean it loaded the URL but somehow the statement "(stringLin e = myDataInputStre am.readLine()) == null" does not return true neither false !
what is going on !? Help guys
And sorry for my grammar.
I'm trying to open a URL and the good news that I can open it then read the data line by line. the data changes every second so i have to read it in an infinite loop. By other words, load the URL then read it line by line, again and again.
the problem the loop stops but no error msgs, memory is not full and there is nothing taking 100% of the CPU !
The while loop code as follow:
while(true){
//the code to load the URL
System.out.prin tln("Start");
while(true){
System.out.prin tln("Check 1");
if((stringLine = myDataInputStre am.readLine()) == null) break;
System.out.prin tln("Check 2");
System.out.prin tln(stringLine) ;
}
System.out.prin tln("End");
}
After 3-4 hours of running the code print Check1 and stops, i does not terminate, just stops without giving any messages!
It do print some of the URL data lines before this happens, it mean it loaded the URL but somehow the statement "(stringLin e = myDataInputStre am.readLine()) == null" does not return true neither false !
what is going on !? Help guys
And sorry for my grammar.
Comment