本文整理汇总了C#中BusAttachment.CancelFindAdvertisedName方法的典型用法代码示例。如果您正苦于以下问题:C# BusAttachment.CancelFindAdvertisedName方法的具体用法?C# BusAttachment.CancelFindAdvertisedName怎么用?C# BusAttachment.CancelFindAdvertisedName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusAttachment
的用法示例。
在下文中一共展示了BusAttachment.CancelFindAdvertisedName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterBusListenerTest
public void RegisterBusListenerTest()
{
BusAttachment service = new BusAttachment("service", true, 4);
service.Start();
service.ConnectAsync(connectSpec).AsTask().Wait();
service.RequestName("org.alljoyn.service", (byte)RequestNameType.DBUS_NAME_DO_NOT_QUEUE);
service.BindSessionPort(78, new ushort[1], new SessionOpts(TrafficType.TRAFFIC_MESSAGES, false,
ProximityType.PROXIMITY_ANY, TransportMaskType.TRANSPORT_ANY), new SessionPortListener(service));
service.AdvertiseName("org.alljoyn.service", TransportMaskType.TRANSPORT_ANY);
BusAttachment bus = new BusAttachment("buslistenertest", true, 4);
BusListenerTest bl = new BusListenerTest(bus);
bus.RegisterBusListener(bl.bl);
listenerRegistered.WaitOne();
bus.Start();
bus.ConnectAsync(connectSpec).AsTask().Wait();
bus.RequestName("org.alljoyn.buslistener", (byte)RequestNameType.DBUS_NAME_DO_NOT_QUEUE);
nameOwnerChanged.WaitOne();
bus.FindAdvertisedName("org.alljoyn.service");
foundAdvertisedName.WaitOne();
service.CancelAdvertiseName("org.alljoyn.service", TransportMaskType.TRANSPORT_ANY);
lostAdvertisedName.WaitOne();
bus.CancelFindAdvertisedName("org.alljoyn.service");
bus.UnregisterBusListener(bl.bl);
listenerUnregistered.WaitOne();
bus.DisconnectAsync(connectSpec).AsTask().Wait();
// BUGBUG: Don't receive the BusDisconnected signal (this will wait indefinitely)
//busDisconnected.WaitOne();
bus.StopAsync().AsTask().Wait();
// BUGBUG: Don't receive the BusStopping signal (this will wait indefinitely)
//busStopping.WaitOne();
}