User Profile

Collapse

Profile Sidebar

Collapse
Geniusg
Geniusg
Last Activity: Jul 24 '09, 09:08 AM
Joined: Jul 9 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi Plater..
    Thanks for replying..
    The Response object is of type System.IO.Strea m. HttpWebResponse .GetResponseStr eam returns a type of Stream object, which doesnt has DataAvailable property :-(
    I have found a workaround for this problem. Inside the loop, I check for bytesSize and if it = -1, i throw an IOException (assuming that network is down). I am testing this piece of code by pulling out the network cable from my system when...
    See more | Go to post

    Leave a comment:


  • code snippet

    Code:
    do
    {
          bytesSize = Response.Read(downBuffer, 0, downBuffer.Length);
          if (bytesSize > 0)
          {
                Local.Write(downBuffer, 0, bytesSize);
                if(!Response.CanRead)
                    break;
                if (goPause == true)
            	break;
         }
    }
    while (bytesSize > 0);
    If there...
    See more | Go to post

    Leave a comment:


  • HttpWebResponse doesnt throws error when network not available

    I am using a HttpWebResponse object to download a file from remote location. The problem is that while going through a loop to download the file, if the network goes off, then the code doesnt throws any exception.
    I checked in .Net framework 1.0 and 1.1 and the same problem persists. Though in 2.0, i get an IOException.
    Can anyone throw some light on this? i am not sure if there is anything fishy about my code or is this a problem with...
    See more | Go to post
No activity results to display
Show More
Working...