public void EndSend(IAsyncResult result) { if (_queueClient != null) { _queueClient.EndSend(result); } else { _sender.EndSend(result); } }
public static void OnSendComplete(IAsyncResult result) { Tuple <QueueClient, string> stateInfo = (Tuple <QueueClient, string>)result.AsyncState; QueueClient queueClient = stateInfo.Item1; string messageId = stateInfo.Item2; try { // Complete Asynchronous Message Send process queueClient.EndSend(result); Console.WriteLine("Asynchronous Message Send for Id = {0} Successful", messageId); } catch (Exception e) { Console.WriteLine("OnSendComplete: Asynchronous Message Send for Id = {0} Failed with Exception = {1}", messageId, e.ToString()); } }