aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/bench_network.cpp7
-rw-r--r--test/bench_network_tls.cpp7
2 files changed, 4 insertions, 10 deletions
diff --git a/test/bench_network.cpp b/test/bench_network.cpp
index ed2642a..82c6268 100644
--- a/test/bench_network.cpp
+++ b/test/bench_network.cpp
@@ -71,7 +71,6 @@ using MsgNetworkByteOp = MsgNetwork<opcode_t>;
struct MyNet: public MsgNetworkByteOp {
const std::string name;
- const NetAddr peer;
TimerEvent ev_period_stat;
ThreadCall tcall;
size_t nrecv;
@@ -79,12 +78,10 @@ struct MyNet: public MsgNetworkByteOp {
MyNet(const salticidae::EventContext &ec,
const std::string name,
- const NetAddr &peer,
double stat_timeout = -1):
MsgNetworkByteOp(ec, MsgNetworkByteOp::Config(
ConnPool::Config().queue_capacity(65536)).burst_size(1000)),
name(name),
- peer(peer),
ev_period_stat(ec, [this, stat_timeout](TimerEvent &) {
SALTICIDAE_LOG_INFO("%.2f mps", nrecv / (double)stat_timeout);
fflush(stderr);
@@ -134,13 +131,13 @@ NetAddr alice_addr("127.0.0.1:1234");
NetAddr bob_addr("127.0.0.1:1235");
int main() {
- salticidae::BoxObj<MyNet> alice = new MyNet(ec, "Alice", bob_addr, 10);
+ salticidae::BoxObj<MyNet> alice = new MyNet(ec, "Alice", 10);
alice->start();
alice->listen(alice_addr);
salticidae::EventContext tec;
salticidae::BoxObj<ThreadCall> tcall = new ThreadCall(tec);
std::thread bob_thread([&tec]() {
- MyNet bob(tec, "Bob", alice_addr);
+ MyNet bob(tec, "Bob");
bob.start();
bob.connect(alice_addr);
try {
diff --git a/test/bench_network_tls.cpp b/test/bench_network_tls.cpp
index 89e39a8..2827a99 100644
--- a/test/bench_network_tls.cpp
+++ b/test/bench_network_tls.cpp
@@ -71,7 +71,6 @@ using MsgNetworkByteOp = MsgNetwork<opcode_t>;
struct MyNet: public MsgNetworkByteOp {
const std::string name;
- const NetAddr peer;
TimerEvent ev_period_stat;
ThreadCall tcall;
size_t nrecv;
@@ -79,7 +78,6 @@ struct MyNet: public MsgNetworkByteOp {
MyNet(const salticidae::EventContext &ec,
const std::string name,
- const NetAddr &peer,
double stat_timeout = -1):
MsgNetworkByteOp(ec, MsgNetworkByteOp::Config(
ConnPool::Config()
@@ -88,7 +86,6 @@ struct MyNet: public MsgNetworkByteOp {
.tls_cert_file("alice.pem")
.tls_key_file("alice.pem")).burst_size(1000)),
name(name),
- peer(peer),
ev_period_stat(ec, [this, stat_timeout](TimerEvent &) {
SALTICIDAE_LOG_INFO("%.2f mps", nrecv / (double)stat_timeout);
fflush(stderr);
@@ -138,13 +135,13 @@ NetAddr alice_addr("127.0.0.1:1234");
NetAddr bob_addr("127.0.0.1:1235");
int main() {
- salticidae::BoxObj<MyNet> alice = new MyNet(ec, "Alice", bob_addr, 10);
+ salticidae::BoxObj<MyNet> alice = new MyNet(ec, "Alice", 10);
alice->start();
alice->listen(alice_addr);
salticidae::EventContext tec;
salticidae::BoxObj<ThreadCall> tcall = new ThreadCall(tec);
std::thread bob_thread([&tec]() {
- MyNet bob(tec, "Bob", alice_addr);
+ MyNet bob(tec, "Bob");
bob.start();
bob.connect(alice_addr);
try {