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
e9065d26
Commit
e9065d26
authored
Jun 22, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stack-reference issues
parent
76831743
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
11 deletions
+16
-11
libcaf_io/test/dynamic_broker.cpp
libcaf_io/test/dynamic_broker.cpp
+4
-2
libcaf_io/test/http_broker.cpp
libcaf_io/test/http_broker.cpp
+2
-2
libcaf_io/test/remote_spawn.cpp
libcaf_io/test/remote_spawn.cpp
+2
-1
libcaf_io/test/typed_broker.cpp
libcaf_io/test/typed_broker.cpp
+4
-2
libcaf_io/test/unpublish.cpp
libcaf_io/test/unpublish.cpp
+4
-4
No files found.
libcaf_io/test/dynamic_broker.cpp
View file @
e9065d26
...
@@ -145,7 +145,8 @@ behavior peer_acceptor_fun(broker* self, const actor& buddy) {
...
@@ -145,7 +145,8 @@ behavior peer_acceptor_fun(broker* self, const actor& buddy) {
}
}
void
run_client
(
int
argc
,
char
**
argv
,
uint16_t
port
)
{
void
run_client
(
int
argc
,
char
**
argv
,
uint16_t
port
)
{
actor_system
system
{
actor_system_config
{}.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
actor_system_config
cfg
;
actor_system
system
{
cfg
.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
auto
p
=
system
.
spawn
(
ping
,
size_t
{
10
});
auto
p
=
system
.
spawn
(
ping
,
size_t
{
10
});
CAF_MESSAGE
(
"spawn_client..."
);
CAF_MESSAGE
(
"spawn_client..."
);
auto
cl
=
system
.
middleman
().
spawn_client
(
peer_fun
,
"127.0.0.1"
,
port
,
p
);
auto
cl
=
system
.
middleman
().
spawn_client
(
peer_fun
,
"127.0.0.1"
,
port
,
p
);
...
@@ -155,7 +156,8 @@ void run_client(int argc, char** argv, uint16_t port) {
...
@@ -155,7 +156,8 @@ void run_client(int argc, char** argv, uint16_t port) {
}
}
void
run_server
(
int
argc
,
char
**
argv
)
{
void
run_server
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
actor_system_config
{}.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
actor_system_config
cfg
;
actor_system
system
{
cfg
.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
scoped_actor
self
{
system
};
scoped_actor
self
{
system
};
CAF_MESSAGE
(
"spawn peer acceptor"
);
CAF_MESSAGE
(
"spawn peer acceptor"
);
auto
serv
=
system
.
middleman
().
spawn_broker
(
peer_acceptor_fun
,
auto
serv
=
system
.
middleman
().
spawn_broker
(
peer_acceptor_fun
,
...
...
libcaf_io/test/http_broker.cpp
View file @
e9065d26
...
@@ -171,8 +171,7 @@ behavior server(broker* self) {
...
@@ -171,8 +171,7 @@ behavior server(broker* self) {
class
fixture
{
class
fixture
{
public:
public:
fixture
()
:
system
(
actor_system_config
{}
fixture
()
:
system
(
cfg
.
load
<
io
::
middleman
,
network
::
test_multiplexer
>
()),
.
load
<
io
::
middleman
,
network
::
test_multiplexer
>
()),
aut_
(
unsafe_actor_handle_init
)
{
aut_
(
unsafe_actor_handle_init
)
{
mpx_
=
dynamic_cast
<
network
::
test_multiplexer
*>
(
&
system
.
middleman
().
backend
());
mpx_
=
dynamic_cast
<
network
::
test_multiplexer
*>
(
&
system
.
middleman
().
backend
());
CAF_REQUIRE
(
mpx_
!=
nullptr
);
CAF_REQUIRE
(
mpx_
!=
nullptr
);
...
@@ -227,6 +226,7 @@ public:
...
@@ -227,6 +226,7 @@ public:
return
{
this
};
return
{
this
};
}
}
actor_system_config
cfg
;
actor_system
system
;
actor_system
system
;
actor
aut_
;
actor
aut_
;
abstract_broker
*
aut_ptr_
;
abstract_broker
*
aut_ptr_
;
...
...
libcaf_io/test/remote_spawn.cpp
View file @
e9065d26
...
@@ -116,7 +116,8 @@ void run_client(int argc, char** argv, uint16_t port) {
...
@@ -116,7 +116,8 @@ void run_client(int argc, char** argv, uint16_t port) {
}
}
void
run_server
(
int
argc
,
char
**
argv
)
{
void
run_server
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
actor_system_config
{}.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
actor_system_config
cfg
;
actor_system
system
{
cfg
.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
auto
serv
=
system
.
spawn
(
server
);
auto
serv
=
system
.
spawn
(
server
);
auto
port
=
system
.
middleman
().
publish
(
serv
,
0
);
auto
port
=
system
.
middleman
().
publish
(
serv
,
0
);
CAF_REQUIRE
(
port
!=
0
);
CAF_REQUIRE
(
port
!=
0
);
...
...
libcaf_io/test/typed_broker.cpp
View file @
e9065d26
...
@@ -159,7 +159,8 @@ acceptor::behavior_type acceptor_fun(acceptor::broker_pointer self,
...
@@ -159,7 +159,8 @@ acceptor::behavior_type acceptor_fun(acceptor::broker_pointer self,
}
}
void
run_client
(
int
argc
,
char
**
argv
,
uint16_t
port
)
{
void
run_client
(
int
argc
,
char
**
argv
,
uint16_t
port
)
{
actor_system
system
{
actor_system_config
{}.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
actor_system_config
cfg
;
actor_system
system
{
cfg
.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
auto
p
=
system
.
spawn
(
ping
,
size_t
{
10
});
auto
p
=
system
.
spawn
(
ping
,
size_t
{
10
});
CAF_MESSAGE
(
"spawn_client_typed..."
);
CAF_MESSAGE
(
"spawn_client_typed..."
);
auto
cl
=
system
.
middleman
().
spawn_client
(
peer_fun
,
"localhost"
,
port
,
p
);
auto
cl
=
system
.
middleman
().
spawn_client
(
peer_fun
,
"localhost"
,
port
,
p
);
...
@@ -169,7 +170,8 @@ void run_client(int argc, char** argv, uint16_t port) {
...
@@ -169,7 +170,8 @@ void run_client(int argc, char** argv, uint16_t port) {
}
}
void
run_server
(
int
argc
,
char
**
argv
)
{
void
run_server
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
actor_system_config
{}.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
actor_system_config
cfg
;
actor_system
system
{
cfg
.
load
<
io
::
middleman
>
().
parse
(
argc
,
argv
)};
scoped_actor
self
{
system
};
scoped_actor
self
{
system
};
auto
serv
=
system
.
middleman
().
spawn_broker
(
acceptor_fun
,
system
.
spawn
(
pong
));
auto
serv
=
system
.
middleman
().
spawn_broker
(
acceptor_fun
,
system
.
spawn
(
pong
));
std
::
thread
child
;
std
::
thread
child
;
...
...
libcaf_io/test/unpublish.cpp
View file @
e9065d26
...
@@ -56,8 +56,7 @@ public:
...
@@ -56,8 +56,7 @@ public:
struct
fixture
{
struct
fixture
{
fixture
()
:
testee
(
unsafe_actor_handle_init
)
{
fixture
()
:
testee
(
unsafe_actor_handle_init
)
{
new
(
&
system
)
actor_system
(
actor_system_config
{}
new
(
&
system
)
actor_system
(
cfg
.
load
<
io
::
middleman
>
()
.
load
<
io
::
middleman
>
()
.
parse
(
test
::
engine
::
argc
(),
.
parse
(
test
::
engine
::
argc
(),
test
::
engine
::
argv
()));
test
::
engine
::
argv
()));
testee
=
system
.
spawn
<
dummy
>
();
testee
=
system
.
spawn
<
dummy
>
();
...
@@ -92,6 +91,7 @@ struct fixture {
...
@@ -92,6 +91,7 @@ struct fixture {
return
result
;
return
result
;
}
}
actor_system_config
cfg
;
union
{
actor_system
system
;
};
// manually control ctor/dtor
union
{
actor_system
system
;
};
// manually control ctor/dtor
actor
testee
;
actor
testee
;
};
};
...
...
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