Free Support Forum - aspose.com

ExchangeClient hanging but not timing out

Hello, I am using ExchangeClient to list messages from a folder in an Exchange server, The folder does not have a large number of mails but other folders in the mailbox do. I have seen the ListMessages(string folder) method hang indefnintely and not timeout ( I have set the timeout flag). Is there any reason why this would happen?


Also, what does the KeepAlive flag on ExchnageClient do?

Hi,

Could you please tell us about the version of Exchange Server, Windows OS (32/64 bit) and Aspose.Network dll? It would be helpful for us if you also specify the number of messages in Inbox. We will check it at our end.

KeepAlive keeps the connection alive with the Exchange Server to avoid disconnection after a specified idle time.

It is Exchange server 2003, Windows Server 2003 32bit and Aspose.Network 4.0.8.12


Note I am not querying the Inbox but a folder under the Inbox. There are less then 10 mails in the Inbox and in the folder I am querying. However there are a lot of mails in other folders in the mailbox. Thanks.

Could you please try the following code to get the messages from subfolder of Inbox:

// get mailbox info
ExchangeMailboxInfo mailbox = client.GetMailboxInfo();

ExchangeMessageInfoCollection msgInboxCollection = client.ListMessages(mailbox.InboxUri + “/subfolder1”);

The issue seems to have been that I was calling into the same exchange server (different mailboxes) at the one time. When I staggered the calls there were no lockups.