Results 1 to 14 of 14

Thread: My app freezes due to internet connection. How to solve this?

Hybrid View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2013
    Location
    Albania
    Posts
    101

    Re: My app freezes due to internet connection. How to solve this?

    Btw, do I need to make this if-check while the whole XML is being loaded and this would mean that I would have to use a do-while loop. Because if I firstly check whether the state is 200 (and wait about 5 seconds if it is not to recheck again) and then after the state = 200, do all the XML loading and parsing? I think that wouldn't make the app freeze but it still would take a lot of time to display the data.
    I still don't get why the app freezes? I mean, if there is any problem with the XML loading or parsing I've added the code to display it, but instead it freezes. Or is it the fact that I am loading a form while another one is still in the process of being completely loaded?

  2. #2
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: My app freezes due to internet connection. How to solve this?

    Quote Originally Posted by kevinKZzaka View Post
    Btw, do I need to make this if-check while the whole XML is being loaded and this would mean that I would have to use a do-while loop. Because if I firstly check whether the state is 200 (and wait about 5 seconds if it is not to recheck again) and then after the state = 200, do all the XML loading and parsing? I think that wouldn't make the app freeze but it still would take a lot of time to display the data.
    When you get the 200 you can load your DOMDocument with the XML. The DOMDocument does all of the parsing, all you are doing is spelunking your way through the resulting DOM (object tree), you are not parsing anything.

    This process should be far faster than getting the data over the Internet.

    Quote Originally Posted by kevinKZzaka View Post
    I still don't get why the app freezes? I mean, if there is any problem with the XML loading or parsing I've added the code to display it, but instead it freezes. Or is it the fact that I am loading a form while another one is still in the process of being completely loaded?
    We haven't seen any of your code but you admitted to using a synchronous .Open call. That is where your program was hanging.


    I'm not sure I can help much more.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width