Clearing PIDataPipe

Discussion created by srogers on Aug 5, 2014
Latest reply on Aug 7, 2014 by Dan Fishman



I'm writing a polling service that initialises a PIDataPipe:

_eventPipe = new PIDataPipe(AFDataPipeType.Snapshot);



Then every x seconds does this:


AFListResults events = _eventPipe.GetUpdateEvents(1000);


Lets say that my server is generating 2000 events every second, and I'm polling and getting 1000 events every second.


Does this mean that:


1 - On my first read after a second I get 1000 of the 2000 events generated in that second

2 - On my read after 2 seconds, I get the other 1000 events from the 1st second interval?


Or, does my first GetUpdateEvents clear the other 1000 events I didn't read so that when I read again after 2 seconds I'm getting new events rather than ones left over?


If it is the first case, is there a method to clear the pipe so I could do :


1 - Read 1000 events after a seond

2 - Clear the pipe

3 - Read 100 new events after 2 seonds




Couldn't see an obvious method in the SDK...


Sam R