Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: Events fired even with EnableEvents FALSE Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
rafaellop
Newbie
Newbie


Joined: 13 September 2007
Online Status: Offline
Posts: 26
Posted: 21 February 2008 at 6:46am | IP Logged Quote rafaellop


Hello again :)

Unfortunately I've again found something I cannot handle only by myself.

The problem is that even with EnableEvents set to false, the POP3 Client events are fired.

However it's not a normal use of the component... I want events only for messages that are bigger than 200 kb. So that before I retrieve a message I check its size and enable or disable events using the EnableEvents property. If a message size is bigger than my limit I set EnableEvents to true. If the size is smaller, I set it to false. The method is for a progress window that should be visible only for big messages.

Code:

     if msgsize > 200000 then
     begin
           showev := true;
           FNewPOP3Client.EnableEvents := true;
     end
     else
     begin
           showev := false;
           FNewPOP3Client.EnableEvents := false;
     end;

     RetrievedMessage := FNewPOP3Client.RetrieveSingleMessage(msgid);

     if showev then
        FNewPOP3Client.EnableEvents := false;



Could you please check this for me ?

Cheers,
Rafal
Back to Top View rafaellop's Profile Search for other posts by rafaellop
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2179
Posted: 21 February 2008 at 6:59am | IP Logged Quote Alex

EnableEvents property won't change its value if you're already connected to the server. This is because EnableEvents controls what type of Windows socket to create. Once Windows socket is created, its type cannot be changed.

Thus, events should always be fired in your app but you can maintain another boolean variable (e.g. blnLargeMessage), set it for large emails to True and check it in your event handler: if it's False, leave the handler immediately.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
rafaellop
Newbie
Newbie


Joined: 13 September 2007
Online Status: Offline
Posts: 26
Posted: 21 February 2008 at 7:24am | IP Logged Quote rafaellop

Ok, but in the documentation you write that EnableEvents is initially set to false because of the performance issues. It's critical for me to have as high performance as possible. Would you confirm that checking the condition inside event handler will have similar performance as EnableEvents = false?

Cheers
Rafal
Back to Top View rafaellop's Profile Search for other posts by rafaellop
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2179
Posted: 21 February 2008 at 7:34am | IP Logged Quote Alex

Well, performance loss due to EnableEvents set to True can be ignored. It's very-very small.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide