How would you handle the downloading of large amount of data?

Discussion in 'Questions (Windows Mobile)' started by moster67, Apr 14, 2009.

  1. moster67

    moster67 Expert Licensed User

    How would you handle the downloading of large amount of data?

    When connecting to a POP3-server using telnet and downloading attachments on my device, I get a after a while (after having received 300-400KB) OutOfMemoryExceptions. Nothing strange about that but since Outlook for PocketPC can handle attachments up to 3-4MB, there must be a way to do it!

    I think I need to take the content of the buffer and write/save it in a file on storage, then I must empty the buffer and start all over again. Is this the best procedure? Any other ways of doing it? Some pseudo-code showing how to do it would be great.

  2. moster67

    moster67 Expert Licensed User

    Sorry for not writing clear enough. No - Pocket Outlook works nicely.

    The problem is my code. I wanted to try out POP3 (using telnet and socket) and download my e-mails and attachments from my provider's mail-server. I have no problems connecting with my code (on my device) to the POP3-server and downloading relative headers and the text containing the e-mails and the attachments.

    As long as I am downloading single e-mails or e-mails with small attachemnts (up to 150KB), I have no particular problems. The problem is when I need to download large amount of data (300KB and more) - then I get OutOfMemoryExceptions.

    I guess that Pocket Outlook, when downloading a file of 3-4MB, retrieves the data in chunks in view of the huge amount of data it must handle and the risk of OutOfMemoryExceptions. So if Pocket Outlook can do this, I guess that I can also do it. That's why I asked if anyone could post some pseudocode for retrieving data in chunks using a socket-connection.


    Last edited: Apr 15, 2009
  3. Erel

    Erel Administrator Staff Member Licensed User

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice