views:

90

answers:

1

Maybe you can help me...

I am writing a program in Windows Mobile that connects to a mail-server and retrieves data from a POP3-server. I am using a third-party (free) socket available from here. I am using VS 2008 (in VB.NET) and the device-emulators.

I can connect without any problems and execute my various commands (such as logging in, STAT, LIST, TOP). However, when I use the RETR-command to download the e-mail, I get after a while an error which I can't track down. If I retrieve a short e-mail, it normally downloads the data without any problems. But if I try to retrieve an e-mail with an attachment (with more bytes to transfer), I generally get an "error" towards 70-80,000 bytes. However, when running the application on my real device, I still get an error but normally towards 400-500,000 although sometimes earlier.

Running this application on the desktop (same third-party socket but another .dll) works without any problems. I can download huge attachments easily. I doubt it is related to network-problems - for instance using Pocket Outlook to download e-mails with attachment from the same mail-server works.

The error does not show up in debugging mode - with this I mean that the code does not stop at a certain line. I have inserted a Try-Catch as well in my code but no error is shown. However, using the debug-output window, I note after a while a line that appears and which reads: "The thread 0x566967f6 has exited with code 0 (0x0)".

I believe the problem is related to the DLL-library (which is an ATL based COM-library) or more likely my way of coding this library but before writing to them, I wanted to see if I can track down the problem to this library and why it may cause my error/problem. In this way, I can furnish more information when I write to them. So, I am just wondering if there is a way in VS 2008 for me to get some more information in regard to my problem/error? Thank you.

+2  A: 

Exit code 0 means no error occurred and that the thread terminated normally. If it's not supposed to be terminating try to figure out under what conditions it can and figure out which one is allowing the thread to exit prematurely.

The only reason I can think of why this might be occurring on a mobile device and not your desktop is something to do with buffers. My guess would be that the smaller, slower devices are having trouble keeping up with the speed of the incoming data and consequently the buffers are being overwritten.

Spencer Ruport
Interesting -I didn't know that buffers could be overwritten. The so called "no-error" does show up when using my WIFI-connection. I will now try it over the GPRS/EDGE and see what happens. Maybe reducing the speed may help or perhaps increasing the buffer-size. Thanks for your suggestions.
moster67