source: azure_iot_hub_f767zi/trunk/azure_iot_sdk/iothub_client/inc/internal/iothub_client_retry_control.h@ 457

Last change on this file since 457 was 457, checked in by coas-nagasima, 4 years ago

ファイルを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 2.0 KB
Line 
1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#ifndef IOTHUB_CLIENT_RETRY_CONTROL
5#define IOTHUB_CLIENT_RETRY_CONTROL
6
7#include <stdlib.h>
8#include <stdbool.h>
9#include "azure_c_shared_utility/optionhandler.h"
10#include "umock_c/umock_c_prod.h"
11#include "iothub_client_core_ll.h"
12#include "internal/iothubtransport.h"
13#include "azure_c_shared_utility/const_defines.h"
14
15#ifdef __cplusplus
16extern "C"
17{
18#endif
19
20static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_INITIAL_WAIT_TIME_IN_SECS = "initial_wait_time_in_secs";
21static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_MAX_JITTER_PERCENT = "max_jitter_percent";
22static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_MAX_DELAY_IN_SECS = "max_delay_in_secs";
23static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_SAVED_OPTIONS = "retry_control_saved_options";
24
25typedef enum RETRY_ACTION_TAG
26{
27 RETRY_ACTION_RETRY_NOW,
28 RETRY_ACTION_RETRY_LATER,
29 RETRY_ACTION_STOP_RETRYING
30} RETRY_ACTION;
31
32struct RETRY_CONTROL_INSTANCE_TAG;
33typedef struct RETRY_CONTROL_INSTANCE_TAG* RETRY_CONTROL_HANDLE;
34
35MOCKABLE_FUNCTION(, RETRY_CONTROL_HANDLE, retry_control_create, IOTHUB_CLIENT_RETRY_POLICY, policy, unsigned int, max_retry_time_in_secs);
36MOCKABLE_FUNCTION(, int, retry_control_should_retry, RETRY_CONTROL_HANDLE, retry_control_handle, RETRY_ACTION*, retry_action);
37MOCKABLE_FUNCTION(, void, retry_control_reset, RETRY_CONTROL_HANDLE, retry_control_handle);
38MOCKABLE_FUNCTION(, int, retry_control_set_option, RETRY_CONTROL_HANDLE, retry_control_handle, const char*, name, const void*, value);
39MOCKABLE_FUNCTION(, OPTIONHANDLER_HANDLE, retry_control_retrieve_options, RETRY_CONTROL_HANDLE, retry_control_handle);
40MOCKABLE_FUNCTION(, void, retry_control_destroy, RETRY_CONTROL_HANDLE, retry_control_handle);
41
42MOCKABLE_FUNCTION(, int, is_timeout_reached, time_t, start_time, unsigned int, timeout_in_secs, bool*, is_timed_out);
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif // IOTHUB_CLIENT_RETRY_CONTROL
Note: See TracBrowser for help on using the repository browser.