C # data throttling

I use a third party component that accepts a maximum of 25 KB of data at a time. I am passing an array of objects to this third-party component from my application.

However, the amount of data that my application writes is much larger than 25 KB. I retrieve data from the database and directly call the component.

I added a link to the component in the application. The data that I pass to the component as an array of an object that contains primitive and non-primitive types.

How can I implement data throttling here?

+5
source share
3 answers

. , -, . , . , Stopwatch.EllapsedSeconds 1 . reset reset , . , , ( ) 25 . System.Thread.Thread.Sleep(Math.Max(1000 - StopWatch.EllapsedMilliseconds, 0)). , , .

+5

. :

  • , ,
  • . Write,
  • 25kb a 1 , , .

, > 25 /, , , .

+3

BufferedStream MSDN. , 25 .

/, , , 25 , 24 , , 1 .

25 , , Thread.Sleep(1000), , .

+2

All Articles