Skip to content

Commit 5bb0ac4

Browse files
committed
Renaming
# Conflicts: # nano/core_test/socket.cpp
1 parent aa281cf commit 5bb0ac4

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

nano/core_test/network.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ TEST (network, purge_dead_channel)
10831083
auto channel = channels.front ();
10841084
ASSERT_TRUE (channel);
10851085

1086-
auto sockets = node1.tcp_listener.sockets ();
1086+
auto sockets = node1.tcp_listener.all_sockets ();
10871087
ASSERT_EQ (sockets.size (), 1);
10881088
auto socket = sockets.front ();
10891089
ASSERT_TRUE (socket);
@@ -1133,7 +1133,7 @@ TEST (network, purge_dead_channel_remote)
11331133
auto channel = channels.front ();
11341134
ASSERT_TRUE (channel);
11351135

1136-
auto sockets = node1.tcp_listener.sockets ();
1136+
auto sockets = node1.tcp_listener.all_sockets ();
11371137
ASSERT_EQ (sockets.size (), 1);
11381138
auto socket = sockets.front ();
11391139
ASSERT_TRUE (socket);

nano/core_test/tcp_listener.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ TEST (tcp_listener, max_connections)
4848

4949
// create space for one socket and fill the connections table again
5050
{
51-
auto sockets1 = node->tcp_listener.sockets ();
51+
auto sockets1 = node->tcp_listener.all_sockets ();
5252
ASSERT_EQ (sockets1.size (), 2);
5353
sockets1[0]->close ();
5454
}
55-
ASSERT_TIMELY_EQ (10s, node->tcp_listener.sockets ().size (), 1);
55+
ASSERT_TIMELY_EQ (10s, node->tcp_listener.all_sockets ().size (), 1);
5656

5757
auto client4 = std::make_shared<nano::transport::tcp_socket> (*node);
5858
client4->async_connect (node->network.endpoint (), connect_handler);
@@ -66,12 +66,12 @@ TEST (tcp_listener, max_connections)
6666

6767
// close all existing sockets and fill the connections table again
6868
{
69-
auto sockets2 = node->tcp_listener.sockets ();
69+
auto sockets2 = node->tcp_listener.all_sockets ();
7070
ASSERT_EQ (sockets2.size (), 2);
7171
sockets2[0]->close ();
7272
sockets2[1]->close ();
7373
}
74-
ASSERT_TIMELY_EQ (10s, node->tcp_listener.sockets ().size (), 0);
74+
ASSERT_TIMELY_EQ (10s, node->tcp_listener.all_sockets ().size (), 0);
7575

7676
auto client6 = std::make_shared<nano::transport::tcp_socket> (*node);
7777
client6->async_connect (node->network.endpoint (), connect_handler);

nano/node/transport/tcp_listener.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ asio::ip::tcp::endpoint nano::transport::tcp_listener::endpoint () const
585585
return { asio::ip::address_v6::loopback (), local.port () };
586586
}
587587

588-
auto nano::transport::tcp_listener::sockets () const -> std::vector<std::shared_ptr<tcp_socket>>
588+
auto nano::transport::tcp_listener::all_sockets () const -> std::deque<std::shared_ptr<tcp_socket>>
589589
{
590590
nano::lock_guard<nano::mutex> lock{ mutex };
591591
auto r = connections
@@ -594,7 +594,7 @@ auto nano::transport::tcp_listener::sockets () const -> std::vector<std::shared_
594594
return { r.begin (), r.end () };
595595
}
596596

597-
auto nano::transport::tcp_listener::servers () const -> std::vector<std::shared_ptr<tcp_server>>
597+
auto nano::transport::tcp_listener::all_servers () const -> std::deque<std::shared_ptr<tcp_server>>
598598
{
599599
nano::lock_guard<nano::mutex> lock{ mutex };
600600
auto r = connections

nano/node/transport/tcp_listener.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class tcp_listener final
7171
size_t realtime_count () const;
7272
size_t bootstrap_count () const;
7373

74-
std::vector<std::shared_ptr<tcp_socket>> sockets () const;
75-
std::vector<std::shared_ptr<tcp_server>> servers () const;
74+
std::deque<std::shared_ptr<tcp_socket>> all_sockets () const;
75+
std::deque<std::shared_ptr<tcp_server>> all_servers () const;
7676

7777
nano::container_info container_info () const;
7878

0 commit comments

Comments
 (0)