diff --git a/nano/node/transport/common.hpp b/nano/node/transport/common.hpp new file mode 100644 index 000000000..58f15ce43 --- /dev/null +++ b/nano/node/transport/common.hpp @@ -0,0 +1,35 @@ +#pragma once + +#include + +namespace nano::transport +{ +/** Policy to affect at which stage a buffer can be dropped */ +enum class buffer_drop_policy +{ + /** Can be dropped by bandwidth limiter (default) */ + limiter, + /** Should not be dropped by bandwidth limiter */ + no_limiter_drop, + /** Should not be dropped by bandwidth limiter or socket write queue limiter */ + no_socket_drop +}; + +enum class socket_type +{ + undefined, + bootstrap, + realtime, + realtime_response_server // special type for tcp channel response server +}; + +std::string_view to_string (socket_type); + +enum class socket_endpoint +{ + server, // Socket was created by accepting an incoming connection + client, // Socket was created by initiating an outgoing connection +}; + +std::string_view to_string (socket_endpoint); +} \ No newline at end of file diff --git a/nano/node/transport/socket.hpp b/nano/node/transport/socket.hpp index c00861475..e16d6c34f 100644 --- a/nano/node/transport/socket.hpp +++ b/nano/node/transport/socket.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -28,35 +29,6 @@ class node; namespace nano::transport { -/** Policy to affect at which stage a buffer can be dropped */ -enum class buffer_drop_policy -{ - /** Can be dropped by bandwidth limiter (default) */ - limiter, - /** Should not be dropped by bandwidth limiter */ - no_limiter_drop, - /** Should not be dropped by bandwidth limiter or socket write queue limiter */ - no_socket_drop -}; - -enum class socket_type -{ - undefined, - bootstrap, - realtime, - realtime_response_server // special type for tcp channel response server -}; - -std::string_view to_string (socket_type); - -enum class socket_endpoint -{ - server, // Socket was created by accepting an incoming connection - client, // Socket was created by initiating an outgoing connection -}; - -std::string_view to_string (socket_endpoint); - /** Socket class for tcp clients and newly accepted connections */ class socket final : public std::enable_shared_from_this {