Exemplo n.º 1
0
 public void Test_EndStartAdvise_After_Dispose()
 {
     using (TestServer server = new TestServer(ServiceName))
     {
         server.Register();
         server.SetData(TopicName, ItemName, 1, Encoding.ASCII.GetBytes(TestData));
         using (DdeClient client = new DdeClient(ServiceName, TopicName))
         {
             client.Connect();
             IAsyncResult ar = client.BeginStartAdvise(ItemName, 1, true, null, null);
             Assert.IsTrue(ar.AsyncWaitHandle.WaitOne(Timeout, false));
             client.Dispose();
             client.EndStartAdvise(ar);
         }
     }
 }