工作代码在这里
static MessageSender TopicClient;
public static void SendTopicMessage(BrokeredMessage message)
{
IAsyncResult result = TopicClient.BeginSend(message, processEndSend, TopicClient);
Thread.Sleep(5000);
}
public static void processEndSend(IAsyncResult result)
{
MessageSender messageSender = result.AsyncState as MessageSender;
messageSender.EndSend(result);
}
上面的代码正在工作。但是我不知道为什么要放 Thread.Sleep()。我不想保留 Thread.Sleep()。但它不起作用我删除了 Thread.Sleep()。有什么建议吗?