Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
682169f9
Commit
682169f9
authored
Nov 06, 2016
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(IONotifyController): сделал количество попыток послать
сообщение заказчику настраеваемым ConsumerSendAttempts(в configure.xml) По умолчанию: 3.
parent
3d601a13
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
IONotifyController.h
include/IONotifyController.h
+1
-0
IONotifyController.cc
src/Processes/IONotifyController.cc
+7
-4
No files found.
include/IONotifyController.h
View file @
682169f9
...
@@ -353,6 +353,7 @@ class IONotifyController:
...
@@ -353,6 +353,7 @@ class IONotifyController:
sigc
::
connection
conUndef
;
sigc
::
connection
conUndef
;
int
maxAttemtps
;
/*! максимальное количество попыток послать сообщение заказчику, после чего он будет удалён из списка */
int
maxAttemtps
;
/*! максимальное количество попыток послать сообщение заказчику, после чего он будет удалён из списка */
int
sendAttemtps
;
/*! максимальное количество попыток послать сообщение заказчику во время изменения датчика */
std
::
mutex
lostConsumersMutex
;
std
::
mutex
lostConsumersMutex
;
...
...
src/Processes/IONotifyController.cc
View file @
682169f9
...
@@ -40,7 +40,8 @@ using namespace std;
...
@@ -40,7 +40,8 @@ using namespace std;
IONotifyController
::
IONotifyController
()
:
IONotifyController
::
IONotifyController
()
:
askIOMutex
(
"askIOMutex"
),
askIOMutex
(
"askIOMutex"
),
trshMutex
(
"trshMutex"
),
trshMutex
(
"trshMutex"
),
maxAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerMaxAttempts"
,
10
))
maxAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerMaxAttempts"
,
10
)),
sendAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerSendAttempts"
,
3
))
{
{
}
}
...
@@ -50,7 +51,8 @@ IONotifyController::IONotifyController(const string& name, const string& section
...
@@ -50,7 +51,8 @@ IONotifyController::IONotifyController(const string& name, const string& section
restorer
(
d
),
restorer
(
d
),
askIOMutex
(
name
+
"askIOMutex"
),
askIOMutex
(
name
+
"askIOMutex"
),
trshMutex
(
name
+
"trshMutex"
),
trshMutex
(
name
+
"trshMutex"
),
maxAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerMaxAttempts"
,
10
))
maxAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerMaxAttempts"
,
10
)),
sendAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerSendAttempts"
,
3
))
{
{
conUndef
=
signal_change_undefined_state
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
onChangeUndefinedState
));
conUndef
=
signal_change_undefined_state
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
onChangeUndefinedState
));
conInit
=
signal_init
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
initItem
));
conInit
=
signal_init
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
initItem
));
...
@@ -61,7 +63,8 @@ IONotifyController::IONotifyController( ObjectId id, std::shared_ptr<NCRestorer>
...
@@ -61,7 +63,8 @@ IONotifyController::IONotifyController( ObjectId id, std::shared_ptr<NCRestorer>
restorer
(
d
),
restorer
(
d
),
askIOMutex
(
string
(
uniset_conf
()
->
oind
->
getMapName
(
id
))
+
"_askIOMutex"
),
askIOMutex
(
string
(
uniset_conf
()
->
oind
->
getMapName
(
id
))
+
"_askIOMutex"
),
trshMutex
(
string
(
uniset_conf
()
->
oind
->
getMapName
(
id
))
+
"_trshMutex"
),
trshMutex
(
string
(
uniset_conf
()
->
oind
->
getMapName
(
id
))
+
"_trshMutex"
),
maxAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerMaxAttempts"
,
10
))
maxAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerMaxAttempts"
,
10
)),
sendAttemtps
(
uniset_conf
()
->
getPIntField
(
"ConsumerSendAttempts"
,
3
))
{
{
conUndef
=
signal_change_undefined_state
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
onChangeUndefinedState
));
conUndef
=
signal_change_undefined_state
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
onChangeUndefinedState
));
conInit
=
signal_init
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
initItem
));
conInit
=
signal_init
().
connect
(
sigc
::
mem_fun
(
*
this
,
&
IONotifyController
::
initItem
));
...
@@ -490,7 +493,7 @@ void IONotifyController::send( ConsumerListInfo& lst, const UniSetTypes::SensorM
...
@@ -490,7 +493,7 @@ void IONotifyController::send( ConsumerListInfo& lst, const UniSetTypes::SensorM
for
(
ConsumerList
::
iterator
li
=
lst
.
clst
.
begin
();
li
!=
lst
.
clst
.
end
();
++
li
)
for
(
ConsumerList
::
iterator
li
=
lst
.
clst
.
begin
();
li
!=
lst
.
clst
.
end
();
++
li
)
{
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
// на каждый объект по две попытки послать
for
(
int
i
=
0
;
i
<
sendAttemtps
;
i
++
)
// на каждый объект по две попытки послать
{
{
try
try
{
{
...
...
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