Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
8d615505
Commit
8d615505
authored
Feb 22, 2013
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed handling of 'TIMEOUT' messages
parent
a66f8fe2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
cppa/detail/receive_policy.hpp
cppa/detail/receive_policy.hpp
+16
-2
No files found.
cppa/detail/receive_policy.hpp
View file @
8d615505
...
@@ -219,6 +219,7 @@ class receive_policy {
...
@@ -219,6 +219,7 @@ class receive_policy {
expired_timeout_message
,
expired_timeout_message
,
expired_sync_response
,
expired_sync_response
,
timeout_message
,
timeout_message
,
timeout_response_message
,
ordinary_message
,
ordinary_message
,
sync_response
sync_response
};
};
...
@@ -232,7 +233,7 @@ class receive_policy {
...
@@ -232,7 +233,7 @@ class receive_policy {
filter_result
filter_msg
(
Client
*
client
,
pointer
node
)
{
filter_result
filter_msg
(
Client
*
client
,
pointer
node
)
{
const
any_tuple
&
msg
=
node
->
msg
;
const
any_tuple
&
msg
=
node
->
msg
;
auto
message_id
=
node
->
mid
;
auto
message_id
=
node
->
mid
;
auto
&
arr
=
detail
::
static_types_array
<
atom_value
,
std
::
uint32_t
>::
arr
;
auto
&
arr
=
detail
::
static_types_array
<
atom_value
,
std
::
uint32_t
>::
arr
;
if
(
msg
.
size
()
==
2
if
(
msg
.
size
()
==
2
&&
msg
.
type_at
(
0
)
==
arr
[
0
]
&&
msg
.
type_at
(
0
)
==
arr
[
0
]
&&
msg
.
type_at
(
1
)
==
arr
[
1
])
{
&&
msg
.
type_at
(
1
)
==
arr
[
1
])
{
...
@@ -255,6 +256,12 @@ class receive_policy {
...
@@ -255,6 +256,12 @@ class receive_policy {
:
expired_timeout_message
;
:
expired_timeout_message
;
}
}
}
}
else
if
(
msg
.
size
()
==
1
&&
msg
.
type_at
(
0
)
==
arr
[
0
]
&&
msg
.
get_as
<
atom_value
>
(
0
)
==
atom
(
"TIMEOUT"
)
&&
message_id
.
is_response
())
{
return
timeout_response_message
;
}
if
(
message_id
.
is_response
())
{
if
(
message_id
.
is_response
())
{
return
(
client
->
awaits
(
message_id
))
?
sync_response
return
(
client
->
awaits
(
message_id
))
?
sync_response
:
expired_sync_response
;
:
expired_sync_response
;
...
@@ -337,6 +344,7 @@ class receive_policy {
...
@@ -337,6 +344,7 @@ class receive_policy {
Fun
&
fun
,
Fun
&
fun
,
message_id_t
awaited_response
,
message_id_t
awaited_response
,
Policy
policy
)
{
Policy
policy
)
{
bool
handle_sync_failure_on_mismatch
=
true
;
if
(
hm_should_skip
(
node
,
policy
))
{
if
(
hm_should_skip
(
node
,
policy
))
{
return
hm_skip_msg
;
return
hm_skip_msg
;
}
}
...
@@ -356,10 +364,16 @@ class receive_policy {
...
@@ -356,10 +364,16 @@ class receive_policy {
}
}
return
hm_msg_handled
;
return
hm_msg_handled
;
}
}
case
timeout_response_message
:
{
handle_sync_failure_on_mismatch
=
false
;
// fall through
}
case
sync_response
:
{
case
sync_response
:
{
if
(
awaited_response
.
valid
()
&&
node
->
mid
==
awaited_response
)
{
if
(
awaited_response
.
valid
()
&&
node
->
mid
==
awaited_response
)
{
auto
previous_node
=
hm_begin
(
client
,
node
,
policy
);
auto
previous_node
=
hm_begin
(
client
,
node
,
policy
);
fun
(
node
->
msg
);
if
(
!
fun
(
node
->
msg
)
&&
handle_sync_failure_on_mismatch
)
{
client
->
handle_sync_failure
();
}
client
->
mark_arrived
(
awaited_response
);
client
->
mark_arrived
(
awaited_response
);
client
->
remove_handler
(
awaited_response
);
client
->
remove_handler
(
awaited_response
);
hm_cleanup
(
client
,
previous_node
,
policy
);
hm_cleanup
(
client
,
previous_node
,
policy
);
...
...
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