Free Support Forum - aspose.com

Mono - 2nd IMapClient Timeout

Hey guys,


We’re using the latest 5.3 Aspose.Email assemblies and have run into a bit of an issue whenever we create the 2nd IMapClient object within a Mono/Mac (Yosemite 10.10) environment. We have a large number of automated tests written in NUnit and this problem is very easy to reproduce. If you had a single test class in which 2 methods both create and disconnect/dispose the IMapClient object, the first one will succeed and the other will basically hang for 40 seconds until you reach the timeout.

We have a very new cross-platform architecture in which all of our tests pass 100% in Windows but running the same tests via Xamarin in OSX fails. If you run each test individually, they all pass. Unfortunately, our current design potentially creates multiple client objects.

I found the following post that sounded eerily similar…

http://www.aspose.com/community/forums/thread/397715/imapexception-when-connecting-the-second-time.aspx

Is this a known issue? Are there any possible workarounds?

Hi Scott,


Thank you for posting your query.

With reference to your mentioned reference thread from our earlier post, we were not able to reproduce it at our end and further feedback was requested from user about the test environment. Are you using multiple ImapClients in your sample application? Could you please share the exact sample code with us so that we can examine it and try to replicate the issue at our end with the same?

Doing nothing more than attempting to construct the client object in separate test methods will result in the 1st test passing and the 2nd test to fail. I experimented with different constructors, removing using statement/Dispose, explicitly calling Disconnect, etc. all to no avail. As mentioned, we have no issues whatsoever constructing multiple client objects in Windows.


Finally, we tried calling different methods to see if it was, in some way, particular to which method is being called. In the end, it didn’t seem to make any difference at all which method is called, whether it’s ListFolder or some other method.

Let me know if you need any additional information. Here’s a stripped down version of the test that we ran yesterday.

[TestFixture]
public class Test
{
[SetUp]
public void Setup()
{
var license = new License();
license.SetLicense(“Aspose.Email.lic”);
}

[Test]
public void ShouldConnectToImap()
{
using (var imapClient = new ImapClient(
993,
“[InsertName]”,
“[InsertPassword]”,
ServerCertificateValidationCallback,
SecurityOptions.Auto))
{
imapClient.ListFolder (“Inbox”);
}
}

[Test]
public void ShouldConnectToImap2()
{
using (var imapClient = new ImapClient(
993,
“[InsertName]”,
“[InsertPassword]”,
ServerCertificateValidationCallback,
SecurityOptions.Auto))
{
imapClient.ListFolder (“Inbox”);
}
}

private static bool ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
}
}

Hi Scott,

Please spare us a little time as we are further investigating this issue at our end. We’ll soon write back here to share our feedback with you.

Hi Scott,

Thank you for being patient.

We have further investigated this issue at our end and were able to reproduce the same problem at our end. It has been logged in our issue tracking system as EMAILNET-34802 for further investigation and rectification by our Product team. We’ll notify you here once there is some information or a fix version available in this regard.

Hi Scott,

Could you please check this issue with the latest version of Aspose.Email for .NET 5.5.0 and share your feedback with us? Please let us know if the issue still occurs at your end or not. We have tested it at our end with the following test environment and were not able to reproduce it with this latest version of the API.

Test Environment Details

Xamarin Studio Version 5.7 (build 660)
Runtime: Mono 3.12.1 ((detached/b7764aa); GTK+ 2.24.23 (Raleigh theme); Package version: 312010000;
Operating System Mac OS X 10.10.0

The issues you have found earlier (filed as EMAILNET-34802) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.