Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
87c3781c
Commit
87c3781c
authored
Jul 09, 2013
by
Michal 'vorner' Vaner
Browse files
[2862] Subscribe and unsubscribe on MCCS
parent
02e0859b
Changes
2
Show whitespace changes
Inline
Side-by-side
src/lib/config/ccsession.h
View file @
87c3781c
...
@@ -575,6 +575,20 @@ public:
...
@@ -575,6 +575,20 @@ public:
/// \param id The id of request as returned by groupRecvMsgAsync.
/// \param id The id of request as returned by groupRecvMsgAsync.
void
cancelAsyncRecv
(
const
AsyncRecvRequestID
&
id
);
void
cancelAsyncRecv
(
const
AsyncRecvRequestID
&
id
);
/// \brief Subscribe to a group
///
/// Wrapper around the CCSession::subscribe.
void
subscribe
(
const
std
::
string
&
group
)
{
session_
.
subscribe
(
group
,
isc
::
cc
::
CC_INSTANCE_WILDCARD
);
}
/// \brief Unsubscribe from a group.
///
/// Wrapper around the CCSession::unsubscribe.
void
unsubscribe
(
const
std
::
string
&
group
)
{
session_
.
unsubscribe
(
group
,
isc
::
cc
::
CC_INSTANCE_WILDCARD
);
}
private:
private:
ModuleSpec
readModuleSpecification
(
const
std
::
string
&
filename
);
ModuleSpec
readModuleSpecification
(
const
std
::
string
&
filename
);
void
startCheck
();
void
startCheck
();
...
...
src/lib/config/tests/ccsession_unittests.cc
View file @
87c3781c
...
@@ -157,6 +157,17 @@ TEST_F(CCSessionTest, notifyNoParams) {
...
@@ -157,6 +157,17 @@ TEST_F(CCSessionTest, notifyNoParams) {
session
.
getMsgQueue
()
->
get
(
1
)
->
toWire
();
session
.
getMsgQueue
()
->
get
(
1
)
->
toWire
();
}
}
// Try to subscribe and unsubscribe once again
TEST_F
(
CCSessionTest
,
subscribe
)
{
ModuleCCSession
mccs
(
ccspecfile
(
"spec1.spec"
),
session
,
NULL
,
NULL
,
false
,
false
);
EXPECT_FALSE
(
session
.
haveSubscription
(
"A group"
,
"*"
));
mccs
.
subscribe
(
"A group"
);
EXPECT_TRUE
(
session
.
haveSubscription
(
"A group"
,
"*"
));
mccs
.
unsubscribe
(
"A group"
);
EXPECT_FALSE
(
session
.
haveSubscription
(
"A group"
,
"*"
));
}
TEST_F
(
CCSessionTest
,
createAnswer
)
{
TEST_F
(
CCSessionTest
,
createAnswer
)
{
ConstElementPtr
answer
;
ConstElementPtr
answer
;
answer
=
createAnswer
();
answer
=
createAnswer
();
...
...
Write
Preview
Supports
Markdown
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