using System;
using System.Net;

namespace NKC_SDK
{
  public class Utils
  {
  }

  /// <summary>
  /// Override metodo WebClient con gestione TimeOut corto
  /// </summary>
  public class WebClientWT : WebClient
  {
    /// <summary>
    /// timeout da conf
    /// </summary>
    protected int urlCallTOut
    {
      get
      {
        // 5 sec timeout
        return 10000;
      }
    }
    protected override WebRequest GetWebRequest(Uri address)
    {
      WebRequest wr = base.GetWebRequest(address);
      wr.Timeout = urlCallTOut; // timeout in milliseconds (ms)
      return wr;
    }
  }
}
