librelist archives

« back to archive

Thread of execution simply disappears after call to -[CTCoreAccount connectToServer:…]

Thread of execution simply disappears after call to -[CTCoreAccount connectToServer:…]

From:
Greg Maletic
Date:
2013-03-06 @ 02:03
I've tried to create two different projects utilizing MailCore, and in 
both cases when I call connectToServer: the app simply stops responding. 
Here's my code:


	CTCoreAccount* account = [[CTCoreAccount alloc] init];
	BOOL success = [account connectToServer:@"[mail server]" port:993 
connectionType:CTConnectionTypeTryStartTLS authType:CTImapAuthTypePlain 
login:@"[username]" password:@"[password]"];
	NSAssert(success, [account.lastError localizedDescription]);
	if (success)
	{
		NSLog(@"Logged in!");
	}

If I single-step through this code, it eventually reaches this code in 
mailstorage.c:

	return storage->sto_driver->sto_connect(storage);

It never returns.


Any idea what is wrong?

Thanks.

Re: [mailcore] Thread of execution simply disappears after call to -[CTCoreAccount connectToServer:…]

From:
Matt Ronge
Date:
2013-03-06 @ 14:29
Hi!

One thing is that for port 993 the connection type should be 
CTConnectionTypeTLS instead of TryStartTLS. Also make sure you are doing 
these calls on a background thread/queue as they will block the UI.


--
Matt Ronge

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







On Mar 5, 2013, at 8:03 PM, Greg Maletic <greg@panic.com> wrote:

> I've tried to create two different projects utilizing MailCore, and in 
both cases when I call connectToServer: the app simply stops responding. 
Here's my code:
> 
> 
> 	CTCoreAccount* account = [[CTCoreAccount alloc] init];
> 	BOOL success = [account connectToServer:@"[mail server]" port:993 
connectionType:CTConnectionTypeTryStartTLS authType:CTImapAuthTypePlain 
login:@"[username]" password:@"[password]"];
> 	NSAssert(success, [account.lastError localizedDescription]);
> 	if (success)
> 	{
> 		NSLog(@"Logged in!");
> 	}
> 
> If I single-step through this code, it eventually reaches this code in 
mailstorage.c:
> 
> 	return storage->sto_driver->sto_connect(storage);
> 
> It never returns.
> 
> 
> Any idea what is wrong?
> 
> Thanks.

Re: [mailcore] Thread of execution simply disappears after call to -[CTCoreAccount connectToServer:…]

From:
Greg Maletic
Date:
2013-03-06 @ 19:06
That fixed it! Thanks.

As a guideline, however: should different ports require different 
connectionType settings? (I'm writing an app where the user can specify 
the port, but I didn't necessarily want them specifying a connectionType!)
How should I set this value to handle the broadest set of cases?

Thanks,

Greg


On Mar 6, 2013, at 6:29 AM, Matt Ronge <mronge@mronge.com> wrote:

> Hi!
> 
> One thing is that for port 993 the connection type should be 
CTConnectionTypeTLS instead of TryStartTLS. Also make sure you are doing 
these calls on a background thread/queue as they will block the UI.
> 
> 
> --
> Matt Ronge
> 
> iOS App Consultant
> Central Atomics Inc.
> http://www.centralatomics.com
> 
> 
> 
> 
> 
> 
> 
> On Mar 5, 2013, at 8:03 PM, Greg Maletic <greg@panic.com> wrote:
> 
>> I've tried to create two different projects utilizing MailCore, and in 
both cases when I call connectToServer: the app simply stops responding. 
Here's my code:
>> 
>> 
>> 	CTCoreAccount* account = [[CTCoreAccount alloc] init];
>> 	BOOL success = [account connectToServer:@"[mail server]" port:993 
connectionType:CTConnectionTypeTryStartTLS authType:CTImapAuthTypePlain 
login:@"[username]" password:@"[password]"];
>> 	NSAssert(success, [account.lastError localizedDescription]);
>> 	if (success)
>> 	{
>> 		NSLog(@"Logged in!");
>> 	}
>> 
>> If I single-step through this code, it eventually reaches this code in 
mailstorage.c:
>> 
>> 	return storage->sto_driver->sto_connect(storage);
>> 
>> It never returns.
>> 
>> 
>> Any idea what is wrong?
>> 
>> Thanks.
> 

Re: [mailcore] Thread of execution simply disappears after call to -[CTCoreAccount connectToServer:…]

From:
Matt Ronge
Date:
2013-03-12 @ 02:59
In general for imap it is usually:

Port 993 - TLS
Port 143 - Either Plain or Start TLS
--
Matt Ronge

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







On Mar 6, 2013, at 1:06 PM, Greg Maletic <greg@panic.com> wrote:

> That fixed it! Thanks.
> 
> As a guideline, however: should different ports require different 
connectionType settings? (I'm writing an app where the user can specify 
the port, but I didn't necessarily want them specifying a connectionType!)
How should I set this value to handle the broadest set of cases?
> 
> Thanks,
> 
> Greg
> 
> 
> On Mar 6, 2013, at 6:29 AM, Matt Ronge <mronge@mronge.com> wrote:
> 
>> Hi!
>> 
>> One thing is that for port 993 the connection type should be 
CTConnectionTypeTLS instead of TryStartTLS. Also make sure you are doing 
these calls on a background thread/queue as they will block the UI.
>> 
>> 
>> --
>> Matt Ronge
>> 
>> iOS App Consultant
>> Central Atomics Inc.
>> http://www.centralatomics.com
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> On Mar 5, 2013, at 8:03 PM, Greg Maletic <greg@panic.com> wrote:
>> 
>>> I've tried to create two different projects utilizing MailCore, and in
both cases when I call connectToServer: the app simply stops responding. 
Here's my code:
>>> 
>>> 
>>> 	CTCoreAccount* account = [[CTCoreAccount alloc] init];
>>> 	BOOL success = [account connectToServer:@"[mail server]" port:993 
connectionType:CTConnectionTypeTryStartTLS authType:CTImapAuthTypePlain 
login:@"[username]" password:@"[password]"];
>>> 	NSAssert(success, [account.lastError localizedDescription]);
>>> 	if (success)
>>> 	{
>>> 		NSLog(@"Logged in!");
>>> 	}
>>> 
>>> If I single-step through this code, it eventually reaches this code in
mailstorage.c:
>>> 
>>> 	return storage->sto_driver->sto_connect(storage);
>>> 
>>> It never returns.
>>> 
>>> 
>>> Any idea what is wrong?
>>> 
>>> Thanks.
>> 
>