Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
osie
Commits
5661b82b
Commit
5661b82b
authored
May 04, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define timeout as a const.
parent
8e1c9e19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
coupler/opc-ua-server/keep_alive.h
coupler/opc-ua-server/keep_alive.h
+3
-0
coupler/opc-ua-server/keep_alive_subscriber.h
coupler/opc-ua-server/keep_alive_subscriber.h
+1
-1
No files found.
coupler/opc-ua-server/keep_alive.h
View file @
5661b82b
...
...
@@ -5,6 +5,9 @@ static unsigned int HEART_BEATS = 0;
const
int
DEFAULT_HEART_BEAT_INTERVAL
=
250
;
static
int
HEART_BEAT_INTERVAL
=
DEFAULT_HEART_BEAT_INTERVAL
;
// the timeout in millis after which a coupler is considered down
const
int
DEFAULT_HEART_BEAT_TIMEOUT_INTERVAL
=
4
*
DEFAULT_HEART_BEAT_INTERVAL
;
// the list of couplers onto which we depend for properly running$
// XXX: assume ONLY 8 couplers!
unsigned
int
HEART_BEAT_ID_LIST
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
...
...
coupler/opc-ua-server/keep_alive_subscriber.h
View file @
5661b82b
...
...
@@ -276,7 +276,7 @@ void callbackCheckHeartBeat() {
// we do have timestamp for this coupler ID
int
last_seen_timestamp_int
=
atoi
(
last_seen_timestamp
);
int
timestamp_delta
=
milli_seconds
-
last_seen_timestamp_int
;
bool
is_down
=
(
timestamp_delta
>
1000
);
bool
is_down
=
(
timestamp_delta
>
DEFAULT_HEART_BEAT_TIMEOUT_INTERVAL
);
if
(
is_down
)
{
UA_LOG_INFO
(
UA_Log_Stdout
,
\
UA_LOGCATEGORY_USERLAND
,
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment