----- Original Message -----From: Andy KellettSent: Sunday, December 21, 2008 11:38 AMSubject: RE: {Disarmed} Re: [wxMS_developers] Issues with POP3/wxSocketClientHi,
I posted some code in a separate message a few minutes ago, I just wanted to point out that the code runs error free when compiled in Release mode, and works as it should when saving the memory block to a file (and viewing it in a text editor). So the problems only appear in Debug mode on VC8/Vista 64. I can live with that I guess hehe.
--
Kind Regards,
Andy 'Fish-Guy' Kellett <andy@...>
http://www.f1-software.com
From: wxMS_developers@yahoogroups.com [mailto:wxMS_developers@yahoogroups.com] On Behalf Of Dave Silvia
Sent: Saturday, December 20, 2008 10:45 PM
To: wxMS_developers@yahoogroups.com
Subject: {Disarmed} Re: [wxMS_developers] Issues with POP3/wxSocketClient
Hi, Andy!
It's a little difficult to discuss the problem when the only information available is that you're using wxSocketClient. The problem may be further up the line. With only this one piece of information, one must assume that everything before the call to wxSocketClient methods/functions to retrieve the messages is performing correctly and that everything that was needed to be done before the wxSocketClient transactions was done!;)
It's much, much easier to talk about problems and issues if you attach your project (or a facsimile) to a posting you make from your email client (Yahoo! Groups does not do attachments!:-< ).
If you're using DialogBlocks, it's even easier to "share" as all one must needs do is attach the .pjd file (DialogBlocks project file). This will allow the receiver to build and run on their own system quite easily.
Any attachments should be in archive format (zip or other) to reduce size (.pjd's are quite large, but very compressible!;) and to make it more likely that the receiver's email client/antispam won't prevent its delivery.
The only thing I can do, from the information available here, is make a "swag" at a possibility. It appears that an "undocumented procedure" in wxSocketBase has to be performed first. I put it in quotes because it actually is documented, but only "before" the fact. That is, most wxWidgets "Base" classes are not intended to be used, only derived from. Hence, a developer (like me!;) doesn't often look at base classes in wxWidgets classes. The assumption being that the derived wxWidgets class is/has taken care of any parent class necessities.
In looking at the wxSocketBase documentation I see a blurb:
>>>>>
wxSocketBase is the base class for all socket-related objects, and it defines all basic IO functionality.
Note: (Workaround for implementation limitation for wxWidgets up to 2.5.x) If you want to use sockets or derived classes such as wxFTP in a secondary thread, call wxSocketBase::Initialize() (undocumented) from the main thread before creating any sockets - in wxApp::OnInit for example.
<<<<<
Now, it does say this is for wxWidgets up to 2.5.x, but it's the only "swag" I've got right now!:-( If it doesn't help, you might like to consider archiving an example and attaching it to an email client generated post.
HTH:
thx,
Dave S.
From a Braille bumper sticker...
If you can read this, you are too close!
wxMS_developers - Development with wxWidgets on MSWindows
http://tech.groups.yahoo.com/group/wxMS_developers/
wxWidgets Code Exchange
http://www.wxCodex.net/> -- On Sat, 20 Dec 2008 21:20:29 -0500 Andy Kellett wrote --
> Hi,
>
> I'm trying to write a really simple POP3 client using wxSocketClient which should connect to
> a POP3 account, and download all messages. It is to be part of my order handling processing
> system and I am having some odd issues that I can't seem to solve.
>
> I am able to handle everything up to retrieving the actual message. I have tried a number of
> different methods to try and get this to work and so far I have not found anything that works
> consistently.
>
> The first method was one I saw on a wxWidgets forum, involving a large string buffer. Call
> the Read() command and add the returned string to the main buffer string, parse the newline
> and remove the entire line to shorten the string, then repeat till the end of the message
> (single line with '.'). This only works a little bit and the socket seems to stop reading
> after a couple of messages, mid message, for no apparent reason.
>
> Another idea I had was to allocate a block of memory big enough to hold the message, and call
> a Read() command with this buffer sixe, thinking the message would just read into memory
> where I can process it further. The problem here is that every so often, it doesn't work. It
> works on about 90% of the messages, but doesn't read in the entire thing, the LIST command
> for the next message still recovers parts of the previous message. The documentation for
> Read() doesn't state if there is a limit on the amount of data it transfers at one time, or
> if there is a way to wait for the buffer to contain a certain amount of data before reading.
>
> I guess my question, is does someone have any POP3 retreival code anywhere, or could explain
> a process on how to make this work? I have found samples on the net for everything except
> POP3 hehe =) Any help is greatly appreciated =) Thanks in advance.
>
> --
> Kind Regards,
>
> Andy 'Fish-Guy' Kellett <andy@...>
avast! Antivirus: Inbound message clean.
Virus Database (VPS): 081221-0, 12/21/2008
Tested on: 12/21/2008 6:04:07 PM
avast! - copyright (c) 1988-2008 ALWIL Software.