librelist archives

« back to archive

Checking if IMAP session is still valid...

Checking if IMAP session is still valid...

From:
Robert La Ferla
Date:
2014-06-23 @ 15:12
How can I check if the MCOIMAPSession instance hasn’t timed out / is still
connected?  I can’t find anything in the ObjC API that allows querying the
connection status.  Also, you can set a time out but is there a 
notification that gets sent out when the connection times out?

Re: [mailcore] Checking if IMAP session is still valid...

From:
Hoa V. Dinh
Date:
2014-06-23 @ 17:24
-noopOperation should help you check the server connection.  
If the session is disconnected, a specific error is returned by the operation.

--  
Hoa V. Dinh


On Monday, June 23, 2014 at 8:12 AM, Robert La Ferla wrote:

> How can I check if the MCOIMAPSession instance hasn’t timed out / is 
still connected? I can’t find anything in the ObjC API that allows 
querying the connection status. Also, you can set a time out but is there 
a notification that gets sent out when the connection times out?
>  
>  

Re: [mailcore] Checking if IMAP session is still valid...

From:
Robert La Ferla
Date:
2014-06-23 @ 17:44
What do you recommend in terms of usage guidelines for this?  Should EVERY
call to the server be prefaced by a call to a NOOP operation?  Does this 
same error occur in other operations?  ie.  Should I have a design that 
makes a call to the MailCore API, checks to see if there was an error, and
if so, creates a new session and retries the call?


On Jun 23, 2014, at 1:24 PM, Hoa V. Dinh <dinh.viet.hoa@gmail.com> wrote:

> -noopOperation should help you check the server connection.
> If the session is disconnected, a specific error is returned by the operation.
> 
> -- 
> Hoa V. Dinh
> 
> On Monday, June 23, 2014 at 8:12 AM, Robert La Ferla wrote:
> 
>> How can I check if the MCOIMAPSession instance hasn’t timed out / is 
still connected? I can’t find anything in the ObjC API that allows 
querying the connection status. Also, you can set a time out but is there 
a notification that gets sent out when the connection times out?
> 

Re: [mailcore] Checking if IMAP session is still valid...

From:
Matt Ronge
Date:
2014-06-24 @ 15:13
I would not recommend doing a NOOP before every call.  

Instead, I would do your second suggestion, on certain errors like a 
stream error, try resetting the connection and trying again. I also 
preemptively reset the connection if I see there is a network condition 
change using Reachability.  

Hope that helps,--
Matt Ronge
http://astro-hq.com
iOS and Mac Apps


On Monday, June 23, 2014 at 12:44 PM, Robert La Ferla wrote:

> What do you recommend in terms of usage guidelines for this?  Should 
EVERY call to the server be prefaced by a call to a NOOP operation?  Does 
this same error occur in other operations?  ie.  Should I have a design 
that makes a call to the MailCore API, checks to see if there was an 
error, and if so, creates a new session and retries the call?
>  
>  
> On Jun 23, 2014, at 1:24 PM, Hoa V. Dinh <dinh.viet.hoa@gmail.com 
(mailto:dinh.viet.hoa@gmail.com)> wrote:
> > -noopOperation should help you check the server connection.  
> > If the session is disconnected, a specific error is returned by the operation.
> >  
> > --  
> > Hoa V. Dinh
> >  
> >  
> > On Monday, June 23, 2014 at 8:12 AM, Robert La Ferla wrote:
> >  
> > > How can I check if the MCOIMAPSession instance hasn’t timed out / is
still connected? I can’t find anything in the ObjC API that allows 
querying the connection status. Also, you can set a time out but is there 
a notification that gets sent out when the connection times out?  
> >  
> >  
>  

Re: [mailcore] Checking if IMAP session is still valid...

From:
Robert La Ferla
Date:
2014-06-24 @ 15:14
Thanks Matt!

On Jun 24, 2014, at 11:13 AM, Matt Ronge <mronge@mronge.com> wrote:

> I would not recommend doing a NOOP before every call.
> 
> Instead, I would do your second suggestion, on certain errors like a 
stream error, try resetting the connection and trying again. I also 
preemptively reset the connection if I see there is a network condition 
change using Reachability.
> 
> Hope that helps,
> --
> Matt Ronge
> http://astro-hq.com
> iOS and Mac Apps
> 
> On Monday, June 23, 2014 at 12:44 PM, Robert La Ferla wrote:
> 
>> What do you recommend in terms of usage guidelines for this?  Should 
EVERY call to the server be prefaced by a call to a NOOP operation?  Does 
this same error occur in other operations?  ie.  Should I have a design 
that makes a call to the MailCore API, checks to see if there was an 
error, and if so, creates a new session and retries the call?
>> 
>> 
>> On Jun 23, 2014, at 1:24 PM, Hoa V. Dinh <dinh.viet.hoa@gmail.com> wrote:
>> 
>>> -noopOperation should help you check the server connection.
>>> If the session is disconnected, a specific error is returned by the operation.
>>> 
>>> -- 
>>> Hoa V. Dinh
>>> 
>>> On Monday, June 23, 2014 at 8:12 AM, Robert La Ferla wrote:
>>> 
>>>> How can I check if the MCOIMAPSession instance hasn’t timed out / is 
still connected? I can’t find anything in the ObjC API that allows 
querying the connection status. Also, you can set a time out but is there 
a notification that gets sent out when the connection times out?
>>> 
>> 
> 

Re: [mailcore] Checking if IMAP session is still valid...

From:
Robert La Ferla
Date:
2014-06-23 @ 17:26
Thanks but I see no method for this in the docs:

http://libmailcore.com/mailcore2/api/Classes/MCOIMAPSession.html

Furthermore, why can’t it be a simple method like - (BOOL) isConnected; or
similar??

Robert


On Jun 23, 2014, at 1:24 PM, Hoa V. Dinh <dinh.viet.hoa@gmail.com> wrote:

> -noopOperation should help you check the server connection.
> If the session is disconnected, a specific error is returned by the operation.
> 
> -- 
> Hoa V. Dinh
> 
> On Monday, June 23, 2014 at 8:12 AM, Robert La Ferla wrote:
> 
>> How can I check if the MCOIMAPSession instance hasn’t timed out / is 
still connected? I can’t find anything in the ObjC API that allows 
querying the connection status. Also, you can set a time out but is there 
a notification that gets sent out when the connection times out?
>