I want to make a web request from one of available IP addresses on server so I use this class:
public class UseIP
{
public string IP { get; private set;
Problem may be with the delegate getting reset on each new request. Try below:
//servicePoint.BindIPEndPointDelegate = null; // Clears all delegates first, for testing
servicePoint.BindIPEndPointDelegate += delegate
{
var address = IPAddress.Parse(this.IP);
return new IPEndPoint(address, 0);
};
Also as far as I know, the endpoints are cached so even clearing the delegate may not work in some cases and they may get reset regardless. You may unload/reload the app domain as the worst case scenario.