I am writing acceptance tests to validate a system and it's data access is all done through web service calls.
Unfortunately, because I make so many calls, so quickly, I run into the following error
System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
I have locally cached as many of the calls as possible, but that's not enough. I can't fake or mock these calls. They have to be real for this level of tests to be valid.
Is there a way to get repeated frequent web service calls to pool?
Or to check if a connection can be made to the service prior to attempting the call, and wait until an available socket exists?
In production the calls are never made at this speed, so the issue won't arise...but it would be nice to have some code in place to allow for the tests to work, and throttle or share the connections.
Thanks