I call BeginReceive() on a SubscriptionClient like this:
client.BeginReceive(newTimeSpan(6,0,0),newAsyncCallback(DownloadResults),null);
And in the DownloadResults() callback I call client.EndReceive() [client is a static member of the class]
staticpublicvoidDownloadResults(IAsyncResult ar){// Get the message from the service bus.
msg = client.EndReceive(ar);if(msg ==null){Console.WriteLine("Error!");return;}}
I noticed that sometimes client.EndReceive() returns null
. It's not very clear to me by looking at the MSDN page for SubscriptionClient.EndReceive() as to exactly when EndReceive() returnsnull
. Is it because the timelimit I specified in BeginReceive() was exceeded? Or is it because there was an error?