We (Magion Universe) use the AF SDK in one of our products that evaluates data using "blocks" chosen by the user. Those blocks include AF blocks which either serve as input or output blocks. Moreover, it uses the AFSDK to read and write from AF and the product is written in C#. Recently we ran into an issue with the input blocks where the amount of connections to AF would stack quickly (a couple connections in the Established state and 80+ in time_wait state). Until, at some point, a new connection to AF could not longer be established and the AFSDK connect/disconnect calls would "hang".
It turned out the solution was to run the evaluation in MTA as opposed to STA. The connections stopped stacking and were limited to a couple Established connections at a time. On a related note, the block disconnects from AF every time it finishes pulling data which results in quite a few reconnects (3/4 per second in the test env.). And every evaluation runs in a seperate thread hence the STA/MTA setting.
My question is whether there is a reason for the connections to stay "open" for so long (remain in "time_wait" state) when running in STA? Whereas they behave normally while running in MTA.
P.S. As this is my first post here, please feel free to move this if it's missplaced