librelist archives

« back to archive

Persistent session

Persistent session

From:
Davide Gullo
Date:
2013-02-10 @ 16:16
Hi everybody,
I have a question about session folder.
I need to use Folders massively and I have a loop to retrieve data from any
folder.
My code use this method:

CTCoreFolder * folder  = [[CTCoreFolder alloc] initWithPath:mailboxName
inAccount:account];

In the above *account* is connected but this method executes Login
everytime. I tried to use also this method from CTCoreAccount:

- (CTCoreFolder *)folderWithPath:(NSString *)path;

but it's the same because it call the above method from CTCoreFolder
which set

connected = NO;
everytime it is initialized.

Is there a simple way to switch quickly from folders but keeping a
persistent connection?

Thanks and Regards,
Davide



-- 
Davide Gullo, Consulente Web
http://www.m4ss.net
gullo@m4ss.net

Re: [mailcore] Persistent session

From:
Matt Ronge
Date:
2013-02-11 @ 18:20
Hi!

Unfortunately, in Mailcore a new connection is created for each folder. 
The library below MailCore, libetpan, is capable of just doing a SELECT 
without a login. However to do that you'd have to bypass MailCore and use 
the low level IMAP code (in mailimap.h). Mailcore is written against the 
higher level C interface in libetpan which creates a new connection when 
changing folders.
--
Matt Ronge

iOS App Consultant
Central Atomics Inc.
http://www.centralatomics.com







On Feb 10, 2013, at 10:16 AM, Davide Gullo <gullo@m4ss.net> wrote:

> Hi everybody,
> I have a question about session folder. 
> I need to use Folders massively and I have a loop to retrieve data from 
any folder. 
> My code use this method:
> 
> CTCoreFolder * folder  = [[CTCoreFolder alloc] initWithPath:mailboxName 
inAccount:account];
> 
> In the above account is connected but this method executes Login 
everytime. I tried to use also this method from CTCoreAccount:
> 
> - (CTCoreFolder *)folderWithPath:(NSString *)path;
> 
> but it's the same because it call the above method from CTCoreFolder which set
> connected = NO;
> everytime it is initialized.
> 
> Is there a simple way to switch quickly from folders but keeping a 
persistent connection?
> 
> Thanks and Regards,
> Davide
> 
> 
> 
> -- 
> Davide Gullo, Consulente Web
> http://www.m4ss.net
> gullo@m4ss.net