PublisherQos publisher_qos = new PublisherQos(); PublisherListener publisher_listener = null; try { participant.get_default_publisher_qos(publisher_qos); } catch (DDS.Exception) { Console.WriteLine("***Error: failed to get default publisher qos"); } Publisher publisher = participant.create_publisher( publisher_qos, publisher_listener, StatusMask.STATUS_MASK_NONE); if (publisher == null) { Console.WriteLine("***Error: failed to create publisher"); }
try { participant.delete_publisher(ref publisher); } catch (DDS.Exception) { Console.WriteLine("***Error: failed to delete publisher"); }