public override void on_data_on_readers( DDS.Subscriber subscriber) { //static int count = 0; Console.WriteLine("SubscriberListener: on_data_on_readers()"); // notify_datareaders() only calls on_data_available for // DataReaders with unread samples try { subscriber.notify_datareaders(); if (++count > 3) { DDS.StatusMask newmask = DDS.StatusMask.STATUS_MASK_ALL; // 'Unmask' DATA_ON_READERS status for listener int tempMask = (int)newmask; DDS.StatusKind tempStatusKind = DDS.StatusKind.DATA_ON_READERS_STATUS; ; int dataOnReaders_mask = (int)tempStatusKind; tempMask = ~(dataOnReaders_mask & tempMask); newmask = (DDS.StatusMask)tempMask; subscriber.set_listener(this, newmask); Console.WriteLine("Unregistering SubscriberListener::on_data_on_readers()"); } } catch (DDS.Exception e) { Console.WriteLine("notify_datareaders() error: {0}", e); } }
public override void on_data_on_readers( DDS.Subscriber subscriber) { Console.WriteLine("ParticipantListener: on_data_on_readers()"); // notify_datareaders() only calls on_data_available for // DataReaders with unread samples try { subscriber.notify_datareaders(); } catch (DDS.Exception e) { Console.WriteLine("notify_datareaders() error: {0}", e); } }