3 #include <winpr/stream.h>
4 #include <winpr/collections.h>
6 #define BUFFER_SIZE 16384
8 int TestStreamPool(
int argc,
char* argv[])
11 char buffer[8192] = { 0 };
16 wStreamPool* pool = StreamPool_New(TRUE, BUFFER_SIZE);
18 s[0] = StreamPool_Take(pool, 0);
19 s[1] = StreamPool_Take(pool, 0);
20 s[2] = StreamPool_Take(pool, 0);
22 printf(
"%s\n", StreamPool_GetStatistics(pool, buffer,
sizeof(buffer)));
28 printf(
"%s\n", StreamPool_GetStatistics(pool, buffer,
sizeof(buffer)));
30 s[3] = StreamPool_Take(pool, 0);
31 s[4] = StreamPool_Take(pool, 0);
33 printf(
"%s\n", StreamPool_GetStatistics(pool, buffer,
sizeof(buffer)));
38 printf(
"%s\n", StreamPool_GetStatistics(pool, buffer,
sizeof(buffer)));
40 s[2] = StreamPool_Take(pool, 0);
41 s[3] = StreamPool_Take(pool, 0);
42 s[4] = StreamPool_Take(pool, 0);
44 printf(
"%s\n", StreamPool_GetStatistics(pool, buffer,
sizeof(buffer)));
67 printf(
"%s\n", StreamPool_GetStatistics(pool, buffer,
sizeof(buffer)));
69 s[2] = StreamPool_Take(pool, 0);
70 s[3] = StreamPool_Take(pool, 0);
71 s[4] = StreamPool_Take(pool, 0);
73 printf(
"%s\n", StreamPool_GetStatistics(pool, buffer,
sizeof(buffer)));
75 StreamPool_Free(pool);