I have an asynchronous socket server. I have encountered a issue where problematic clients and hard to reproduce network events cause an insane number of byte[]'s to get pinned. Since all the threading to handle clients is implicit (I use BeginAcceptClient, and I use callbacks instead of threads that are explicitly instantiated) I don't control the pinning process. By "implicit threading" I mean threads generated not by me directly, but by the runtime hosting my application.
At any rate the answer in this post shows how to unpin objects. Is it possible to override the behind the scenes pinning if I go on ahead and pin my byte[]'s myself, do the BeginRead and unpin during cleanup?
Thanks.