playing around with Azure IotHub, I came across the following piece of code, in the Console Sample of Iot Protocol Gateway.
// optimizing IOCP performance
int minWorkerThreads;
int minCompletionPortThreads;
ThreadPool.GetMinThreads(out minWorkerThreads, out minCompletionPortThreads);
ThreadPool.SetMinThreads(minWorkerThreads, Math.Max(16, minCompletionPortThreads));
At first I had no idea what IOCP is, so I looked at wikipedia for answers. it basically says that it is an API for async I/O operations on windows.
The question is, what is this piece of code actually doing, and how is it optimizing IOCP performance. The other thing is, why isn't it optimized by default, and when is it useful?
This is the repo from where I got the code