Author Topic: Chilkat.Imap - One long running instance or short lived ones as needed?  (Read 344 times)

will.blackburn

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Apologies if this seems an obvious answer...  :-[

... But I've been trying to work out if it's better to create a single long lived instance of the Imap object that exists over the entire Program or Thread/Task or if I should create an instance at the time I need the email information during the programming process.

Thinking it through and reading the RFC documents, I believe that a long running instance is the way to do it as long as the connection is kept alive or checked and re-connected to as required, but there isn't a clear explanation that I've found and each of the examples always Chilkat gives only show a single process with no reference as to how much "work" is acceptable for the instance.  ???

Any pointers or advice or just confirmation would be great...

Chilkat

  • Administrator
  • Full Member
  • *****
  • Posts: 103
  • Karma: +6/-0
    • View Profile
I think keeping the connection long-term is the best way to go.  It might be a good idea to call imap.Noop once every few minutes when there is no activity.