/// <summary> /// Send query when expired /// </summary> /// <param name="requestType">Request type</param> /// <param name="milliseconds">Milliseconds</param> public void SendQueryWhenExpired(ERequestType requestType, uint milliseconds) { uint t = (uint)(DateTime.Now.Subtract(requestsRequired.GetLastRequestTime(requestType)).TotalMilliseconds); if (t >= milliseconds) { SendQueryAsync(requestType); } }
/// <summary> /// Send query when expired /// </summary> /// <param name="requestType">Request type</param> /// <param name="milliseconds">Milliseconds</param> /// <returns>"true" if attempted sending query, othewrwise "false"</returns> public bool SendQueryWhenExpiredAsync(ERequestResponseType requestType, uint milliseconds) { uint t = (uint)(DateTime.Now.Subtract(requestsRequired.GetLastRequestTime(requestType)).TotalMilliseconds); bool ret = (t >= milliseconds); if (ret) { SendQueryAsync(requestType); } return(ret); }