diff --git a/Makefile.am b/Makefile.am
index 7f21cd408..65ba76e1b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -54,8 +54,7 @@ src_libbitcoin_network_la_SOURCES = \
src/log/capture.cpp \
src/log/logger.cpp \
src/log/reporter.cpp \
- src/messages/monad_body.cpp \
- src/messages/rpc_body.cpp \
+ src/messages/http_body.cpp \
src/messages/http/fields.cpp \
src/messages/http/enums/media_type.cpp \
src/messages/http/enums/target.cpp \
@@ -100,6 +99,8 @@ src_libbitcoin_network_la_SOURCES = \
src/messages/peer/detail/version.cpp \
src/messages/peer/detail/version_acknowledge.cpp \
src/messages/peer/detail/witness_tx_id_relay.cpp \
+ src/messages/rpc/body.cpp \
+ src/messages/rpc/model.cpp \
src/net/acceptor.cpp \
src/net/connector.cpp \
src/net/deadline.cpp \
@@ -120,7 +121,6 @@ src_libbitcoin_network_la_SOURCES = \
src/protocols/protocol_version_70001.cpp \
src/protocols/protocol_version_70002.cpp \
src/protocols/protocol_version_70016.cpp \
- src/rpc/model.cpp \
src/sessions/session.cpp \
src/sessions/session_inbound.cpp \
src/sessions/session_manual.cpp \
@@ -169,12 +169,10 @@ test_libbitcoin_network_test_SOURCES = \
test/config/utilities.cpp \
test/log/timer.cpp \
test/log/tracker.cpp \
+ test/messages/http_body_reader.cpp \
+ test/messages/http_body_writer.cpp \
test/messages/json_body_reader.cpp \
test/messages/json_body_writer.cpp \
- test/messages/monad_body_reader.cpp \
- test/messages/monad_body_writer.cpp \
- test/messages/rpc_body_reader.cpp \
- test/messages/rpc_body_writer.cpp \
test/messages/http/fields.cpp \
test/messages/http/method.cpp \
test/messages/http/enums/magic_numbers.cpp \
@@ -225,6 +223,13 @@ test_libbitcoin_network_test_SOURCES = \
test/messages/peer/enums/level.cpp \
test/messages/peer/enums/magic_numbers.cpp \
test/messages/peer/enums/service.cpp \
+ test/messages/rpc/any.cpp \
+ test/messages/rpc/body_reader.cpp \
+ test/messages/rpc/body_writer.cpp \
+ test/messages/rpc/broadcaster.cpp \
+ test/messages/rpc/dispatcher.cpp \
+ test/messages/rpc/method.cpp \
+ test/messages/rpc/types.cpp \
test/net/acceptor.cpp \
test/net/connector.cpp \
test/net/deadline.cpp \
@@ -245,11 +250,6 @@ test_libbitcoin_network_test_SOURCES = \
test/protocols/protocol_version_70001.cpp \
test/protocols/protocol_version_70002.cpp \
test/protocols/protocol_version_70016.cpp \
- test/rpc/any.cpp \
- test/rpc/broadcaster.cpp \
- test/rpc/dispatcher.cpp \
- test/rpc/method.cpp \
- test/rpc/types.cpp \
test/sessions/session.cpp \
test/sessions/session_html.cpp \
test/sessions/session_inbound.cpp \
@@ -335,10 +335,10 @@ include_bitcoin_network_impl_messagesdir = ${includedir}/bitcoin/network/impl/me
include_bitcoin_network_impl_messages_HEADERS = \
include/bitcoin/network/impl/messages/json_body.ipp
-include_bitcoin_network_impl_rpcdir = ${includedir}/bitcoin/network/impl/rpc
-include_bitcoin_network_impl_rpc_HEADERS = \
- include/bitcoin/network/impl/rpc/broadcaster.ipp \
- include/bitcoin/network/impl/rpc/dispatcher.ipp
+include_bitcoin_network_impl_messages_rpcdir = ${includedir}/bitcoin/network/impl/messages/rpc
+include_bitcoin_network_impl_messages_rpc_HEADERS = \
+ include/bitcoin/network/impl/messages/rpc/broadcaster.ipp \
+ include/bitcoin/network/impl/messages/rpc/dispatcher.ipp
include_bitcoin_network_interfacedir = ${includedir}/bitcoin/network/interface
include_bitcoin_network_interface_HEADERS = \
@@ -359,15 +359,15 @@ include_bitcoin_network_log_HEADERS = \
include_bitcoin_network_messagesdir = ${includedir}/bitcoin/network/messages
include_bitcoin_network_messages_HEADERS = \
+ include/bitcoin/network/messages/http_body.hpp \
+ include/bitcoin/network/messages/http_method.hpp \
include/bitcoin/network/messages/json_body.hpp \
- include/bitcoin/network/messages/messages.hpp \
- include/bitcoin/network/messages/monad_body.hpp \
- include/bitcoin/network/messages/rpc_body.hpp
+ include/bitcoin/network/messages/messages.hpp
include_bitcoin_network_messages_httpdir = ${includedir}/bitcoin/network/messages/http
include_bitcoin_network_messages_http_HEADERS = \
include/bitcoin/network/messages/http/fields.hpp \
- include/bitcoin/network/messages/http/method.hpp
+ include/bitcoin/network/messages/http/http.hpp
include_bitcoin_network_messages_http_enumsdir = ${includedir}/bitcoin/network/messages/http/enums
include_bitcoin_network_messages_http_enums_HEADERS = \
@@ -432,6 +432,23 @@ include_bitcoin_network_messages_peer_enums_HEADERS = \
include/bitcoin/network/messages/peer/enums/magic_numbers.hpp \
include/bitcoin/network/messages/peer/enums/service.hpp
+include_bitcoin_network_messages_rpcdir = ${includedir}/bitcoin/network/messages/rpc
+include_bitcoin_network_messages_rpc_HEADERS = \
+ include/bitcoin/network/messages/rpc/any.hpp \
+ include/bitcoin/network/messages/rpc/body.hpp \
+ include/bitcoin/network/messages/rpc/broadcaster.hpp \
+ include/bitcoin/network/messages/rpc/dispatcher.hpp \
+ include/bitcoin/network/messages/rpc/method.hpp \
+ include/bitcoin/network/messages/rpc/model.hpp \
+ include/bitcoin/network/messages/rpc/publish.hpp \
+ include/bitcoin/network/messages/rpc/rpc.hpp \
+ include/bitcoin/network/messages/rpc/types.hpp
+
+include_bitcoin_network_messages_rpc_enumsdir = ${includedir}/bitcoin/network/messages/rpc/enums
+include_bitcoin_network_messages_rpc_enums_HEADERS = \
+ include/bitcoin/network/messages/rpc/enums/grouping.hpp \
+ include/bitcoin/network/messages/rpc/enums/version.hpp
+
include_bitcoin_network_netdir = ${includedir}/bitcoin/network/net
include_bitcoin_network_net_HEADERS = \
include/bitcoin/network/net/acceptor.hpp \
@@ -462,22 +479,6 @@ include_bitcoin_network_protocols_HEADERS = \
include/bitcoin/network/protocols/protocol_ws.hpp \
include/bitcoin/network/protocols/protocols.hpp
-include_bitcoin_network_rpcdir = ${includedir}/bitcoin/network/rpc
-include_bitcoin_network_rpc_HEADERS = \
- include/bitcoin/network/rpc/any.hpp \
- include/bitcoin/network/rpc/broadcaster.hpp \
- include/bitcoin/network/rpc/dispatcher.hpp \
- include/bitcoin/network/rpc/method.hpp \
- include/bitcoin/network/rpc/model.hpp \
- include/bitcoin/network/rpc/publish.hpp \
- include/bitcoin/network/rpc/rpc.hpp \
- include/bitcoin/network/rpc/types.hpp
-
-include_bitcoin_network_rpc_enumsdir = ${includedir}/bitcoin/network/rpc/enums
-include_bitcoin_network_rpc_enums_HEADERS = \
- include/bitcoin/network/rpc/enums/grouping.hpp \
- include/bitcoin/network/rpc/enums/version.hpp
-
include_bitcoin_network_sessionsdir = ${includedir}/bitcoin/network/sessions
include_bitcoin_network_sessions_HEADERS = \
include/bitcoin/network/sessions/session.hpp \
diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt
index f1f4f93f7..a8a499b45 100644
--- a/builds/cmake/CMakeLists.txt
+++ b/builds/cmake/CMakeLists.txt
@@ -236,8 +236,7 @@ add_library( ${CANONICAL_LIB_NAME}
"../../src/log/capture.cpp"
"../../src/log/logger.cpp"
"../../src/log/reporter.cpp"
- "../../src/messages/monad_body.cpp"
- "../../src/messages/rpc_body.cpp"
+ "../../src/messages/http_body.cpp"
"../../src/messages/http/fields.cpp"
"../../src/messages/http/enums/media_type.cpp"
"../../src/messages/http/enums/target.cpp"
@@ -282,6 +281,8 @@ add_library( ${CANONICAL_LIB_NAME}
"../../src/messages/peer/detail/version.cpp"
"../../src/messages/peer/detail/version_acknowledge.cpp"
"../../src/messages/peer/detail/witness_tx_id_relay.cpp"
+ "../../src/messages/rpc/body.cpp"
+ "../../src/messages/rpc/model.cpp"
"../../src/net/acceptor.cpp"
"../../src/net/connector.cpp"
"../../src/net/deadline.cpp"
@@ -302,7 +303,6 @@ add_library( ${CANONICAL_LIB_NAME}
"../../src/protocols/protocol_version_70001.cpp"
"../../src/protocols/protocol_version_70002.cpp"
"../../src/protocols/protocol_version_70016.cpp"
- "../../src/rpc/model.cpp"
"../../src/sessions/session.cpp"
"../../src/sessions/session_inbound.cpp"
"../../src/sessions/session_manual.cpp"
@@ -375,12 +375,10 @@ if (with-tests)
"../../test/config/utilities.cpp"
"../../test/log/timer.cpp"
"../../test/log/tracker.cpp"
+ "../../test/messages/http_body_reader.cpp"
+ "../../test/messages/http_body_writer.cpp"
"../../test/messages/json_body_reader.cpp"
"../../test/messages/json_body_writer.cpp"
- "../../test/messages/monad_body_reader.cpp"
- "../../test/messages/monad_body_writer.cpp"
- "../../test/messages/rpc_body_reader.cpp"
- "../../test/messages/rpc_body_writer.cpp"
"../../test/messages/http/fields.cpp"
"../../test/messages/http/method.cpp"
"../../test/messages/http/enums/magic_numbers.cpp"
@@ -431,6 +429,13 @@ if (with-tests)
"../../test/messages/peer/enums/level.cpp"
"../../test/messages/peer/enums/magic_numbers.cpp"
"../../test/messages/peer/enums/service.cpp"
+ "../../test/messages/rpc/any.cpp"
+ "../../test/messages/rpc/body_reader.cpp"
+ "../../test/messages/rpc/body_writer.cpp"
+ "../../test/messages/rpc/broadcaster.cpp"
+ "../../test/messages/rpc/dispatcher.cpp"
+ "../../test/messages/rpc/method.cpp"
+ "../../test/messages/rpc/types.cpp"
"../../test/net/acceptor.cpp"
"../../test/net/connector.cpp"
"../../test/net/deadline.cpp"
@@ -451,11 +456,6 @@ if (with-tests)
"../../test/protocols/protocol_version_70001.cpp"
"../../test/protocols/protocol_version_70002.cpp"
"../../test/protocols/protocol_version_70016.cpp"
- "../../test/rpc/any.cpp"
- "../../test/rpc/broadcaster.cpp"
- "../../test/rpc/dispatcher.cpp"
- "../../test/rpc/method.cpp"
- "../../test/rpc/types.cpp"
"../../test/sessions/session.cpp"
"../../test/sessions/session_html.cpp"
"../../test/sessions/session_inbound.cpp"
diff --git a/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj b/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj
index dbf25e770..d35cce7f1 100644
--- a/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj
+++ b/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj
@@ -155,10 +155,10 @@
$(IntDir)test_messages_http_method.obj
+
+
-
-
$(IntDir)test_messages_peer_detail_address.obj
@@ -208,8 +208,15 @@
-
-
+
+
+
+
+
+
+ $(IntDir)test_messages_rpc_method.obj
+
+
@@ -231,13 +238,6 @@
-
-
-
-
- $(IntDir)test_rpc_method.obj
-
-
diff --git a/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj.filters b/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj.filters
index 2a5db43f3..9abeb9195 100644
--- a/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj.filters
+++ b/builds/msvc/vs2022/libbitcoin-network-test/libbitcoin-network-test.vcxproj.filters
@@ -14,7 +14,7 @@
{D28FC18A-8B81-4247-0000-000000000001}
- {D28FC18A-8B81-4247-0000-00000000000A}
+ {D28FC18A-8B81-4247-0000-000000000009}
{D28FC18A-8B81-4247-0000-000000000002}
@@ -29,13 +29,13 @@
{D28FC18A-8B81-4247-0000-000000000005}
- {D28FC18A-8B81-4247-0000-00000000000B}
+ {D28FC18A-8B81-4247-0000-00000000000A}
{D28FC18A-8B81-4247-0000-00000000000D}
- {D28FC18A-8B81-4247-0000-00000000000C}
+ {D28FC18A-8B81-4247-0000-00000000000B}
{D28FC18A-8B81-4247-0000-00000000000E}
@@ -43,17 +43,17 @@
{D28FC18A-8B81-4247-0000-00000000000F}
+
+ {D28FC18A-8B81-4247-0000-00000000000C}
+
{D28FC18A-8B81-4247-0000-000000000006}
{D28FC18A-8B81-4247-0000-000000000007}
-
- {D28FC18A-8B81-4247-0000-000000000008}
-
- {D28FC18A-8B81-4247-0000-000000000009}
+ {D28FC18A-8B81-4247-0000-000000000008}
@@ -150,16 +150,16 @@
src\messages\http
-
+
src\messages
-
+
src\messages
-
+
src\messages
-
+
src\messages
@@ -297,11 +297,26 @@
src\messages\peer
-
- src\messages
+
+ src\messages\rpc
-
- src\messages
+
+ src\messages\rpc
+
+
+ src\messages\rpc
+
+
+ src\messages\rpc
+
+
+ src\messages\rpc
+
+
+ src\messages\rpc
+
+
+ src\messages\rpc
src
@@ -366,21 +381,6 @@
src\protocols
-
- src\rpc
-
-
- src\rpc
-
-
- src\rpc
-
-
- src\rpc
-
-
- src\rpc
-
src\sessions
diff --git a/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj b/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj
index 56fbe5986..9740d1580 100644
--- a/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj
+++ b/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj
@@ -143,7 +143,7 @@
-
+
$(IntDir)src_messages_peer_detail_address.obj
@@ -187,7 +187,8 @@
-
+
+
@@ -209,7 +210,6 @@
-
@@ -270,10 +270,11 @@
-
+
+
+
-
@@ -320,7 +321,17 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -346,16 +357,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -378,8 +379,8 @@
-
-
+
+
diff --git a/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj.filters b/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj.filters
index c43582d76..9e9a46971 100644
--- a/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj.filters
+++ b/builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj.filters
@@ -20,7 +20,7 @@
{564EB540-D6B6-425C-0000-000000000002}
- {564EB540-D6B6-425C-0000-0000000000C1}
+ {564EB540-D6B6-425C-0000-0000000000B1}
{564EB540-D6B6-425C-0000-000000000003}
@@ -32,15 +32,15 @@
{564EB540-D6B6-425C-0000-000000000005}
- {564EB540-D6B6-425C-0000-0000000000D1}
+ {564EB540-D6B6-425C-0000-0000000000C1}
- {564EB540-D6B6-425C-0000-000000000002}
+ {564EB540-D6B6-425C-0000-0000000000E1}
- {564EB540-D6B6-425C-0000-0000000000E1}
+ {564EB540-D6B6-425C-0000-0000000000D1}
-
+
{564EB540-D6B6-425C-0000-0000000000F1}
@@ -53,13 +53,13 @@
{564EB540-D6B6-425C-0000-000000000008}
- {564EB540-D6B6-425C-0000-000000000003}
+ {564EB540-D6B6-425C-0000-000000000002}
{564EB540-D6B6-425C-0000-000000000005}
- {564EB540-D6B6-425C-0000-000000000004}
+ {564EB540-D6B6-425C-0000-000000000003}
{564EB540-D6B6-425C-0000-000000000006}
@@ -67,20 +67,20 @@
{564EB540-D6B6-425C-0000-000000000007}
+
+ {564EB540-D6B6-425C-0000-000000000004}
+
+
+ {564EB540-D6B6-425C-0000-000000000008}
+
{564EB540-D6B6-425C-0000-000000000009}
{564EB540-D6B6-425C-0000-000000000010}
-
- {564EB540-D6B6-425C-0000-0000000000A1}
-
-
- {564EB540-D6B6-425C-0000-000000000008}
-
- {564EB540-D6B6-425C-0000-0000000000B1}
+ {564EB540-D6B6-425C-0000-0000000000A1}
{564EB540-D6B6-425C-0000-000000000009}
@@ -104,28 +104,28 @@
{564EB540-D6B6-425C-0000-000000000005}
- {564EB540-D6B6-425C-0000-00000000000A}
+ {564EB540-D6B6-425C-0000-000000000009}
{564EB540-D6B6-425C-0000-00000000000C}
- {564EB540-D6B6-425C-0000-00000000000B}
+ {564EB540-D6B6-425C-0000-00000000000A}
{564EB540-D6B6-425C-0000-00000000000D}
+
+ {564EB540-D6B6-425C-0000-00000000000B}
+
{564EB540-D6B6-425C-0000-000000000006}
{564EB540-D6B6-425C-0000-000000000007}
-
- {564EB540-D6B6-425C-0000-000000000008}
-
- {564EB540-D6B6-425C-0000-000000000009}
+ {564EB540-D6B6-425C-0000-000000000008}
@@ -189,7 +189,7 @@
src\messages\http
-
+
src\messages
@@ -315,8 +315,11 @@
src\messages\peer
-
- src\messages
+
+ src\messages\rpc
+
+
+ src\messages\rpc
src
@@ -381,9 +384,6 @@
src\protocols
-
- src\rpc
-
src\sessions
@@ -560,16 +560,19 @@
include\bitcoin\network\messages\http
-
+
include\bitcoin\network\messages\http
-
+
include\bitcoin\network\messages
-
+
+ include\bitcoin\network\messages
+
+
include\bitcoin\network\messages
-
+
include\bitcoin\network\messages
@@ -710,8 +713,38 @@
include\bitcoin\network\messages\peer
-
- include\bitcoin\network\messages
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc\enums
+
+
+ include\bitcoin\network\messages\rpc\enums
+
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc
+
+
+ include\bitcoin\network\messages\rpc
include\bitcoin\network
@@ -788,36 +821,6 @@
include\bitcoin\network\protocols
-
- include\bitcoin\network\rpc
-
-
- include\bitcoin\network\rpc
-
-
- include\bitcoin\network\rpc
-
-
- include\bitcoin\network\rpc\enums
-
-
- include\bitcoin\network\rpc\enums
-
-
- include\bitcoin\network\rpc
-
-
- include\bitcoin\network\rpc
-
-
- include\bitcoin\network\rpc
-
-
- include\bitcoin\network\rpc
-
-
- include\bitcoin\network\rpc
-
include\bitcoin\network\sessions
@@ -880,11 +883,11 @@
include\bitcoin\network\impl\messages
-
- include\bitcoin\network\impl\rpc
+
+ include\bitcoin\network\impl\messages\rpc
-
- include\bitcoin\network\impl\rpc
+
+ include\bitcoin\network\impl\messages\rpc
diff --git a/include/bitcoin/network.hpp b/include/bitcoin/network.hpp
index f6c7a15aa..cfc6da2eb 100644
--- a/include/bitcoin/network.hpp
+++ b/include/bitcoin/network.hpp
@@ -61,12 +61,12 @@
#include
#include
#include
+#include
+#include
#include
#include
-#include
-#include
#include
-#include
+#include
#include
#include
#include
@@ -118,6 +118,17 @@
#include
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#include
#include
#include
@@ -142,16 +153,6 @@
#include
#include
#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
#include
#include
#include
diff --git a/include/bitcoin/network/channels/channel_http.hpp b/include/bitcoin/network/channels/channel_http.hpp
index 103ab3846..17db27f58 100644
--- a/include/bitcoin/network/channels/channel_http.hpp
+++ b/include/bitcoin/network/channels/channel_http.hpp
@@ -27,7 +27,6 @@
#include
#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/include/bitcoin/network/channels/channel_peer.hpp b/include/bitcoin/network/channels/channel_peer.hpp
index 421b8448e..98f8b7eec 100644
--- a/include/bitcoin/network/channels/channel_peer.hpp
+++ b/include/bitcoin/network/channels/channel_peer.hpp
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/define.hpp b/include/bitcoin/network/define.hpp
index 7a23e3116..730f79c31 100644
--- a/include/bitcoin/network/define.hpp
+++ b/include/bitcoin/network/define.hpp
@@ -155,11 +155,10 @@ namespace network {
// /async : define
// /log : define /async
-// /messages : define memory
-// /config : define /messages /async
+// /messages : define memory /async
+// /config : define /messages
+// /interface : define /messages
// /net : define settings memory /config /log
-// /rpc : define /messages /async
-// /interface : define /rpc
// /channels : define /net /interface
// /sessions : define /channels
// /protocols : define /sessions
diff --git a/include/bitcoin/network/impl/rpc/broadcaster.ipp b/include/bitcoin/network/impl/messages/rpc/broadcaster.ipp
similarity index 95%
rename from include/bitcoin/network/impl/rpc/broadcaster.ipp
rename to include/bitcoin/network/impl/messages/rpc/broadcaster.ipp
index 42d78794c..74c4c5cc3 100644
--- a/include/bitcoin/network/impl/rpc/broadcaster.ipp
+++ b/include/bitcoin/network/impl/messages/rpc/broadcaster.ipp
@@ -16,15 +16,15 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_BROADCASTER_IPP
-#define LIBBITCOIN_NETWORK_RPC_BROADCASTER_IPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_BROADCASTER_IPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_BROADCASTER_IPP
#include
#include
#include
#include
-#include
-#include
+#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/impl/rpc/dispatcher.ipp b/include/bitcoin/network/impl/messages/rpc/dispatcher.ipp
similarity index 97%
rename from include/bitcoin/network/impl/rpc/dispatcher.ipp
rename to include/bitcoin/network/impl/messages/rpc/dispatcher.ipp
index 3ef5e5133..276917bb7 100644
--- a/include/bitcoin/network/impl/rpc/dispatcher.ipp
+++ b/include/bitcoin/network/impl/messages/rpc/dispatcher.ipp
@@ -16,8 +16,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_DISPATCHER_IPP
-#define LIBBITCOIN_NETWORK_RPC_DISPATCHER_IPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_DISPATCHER_IPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_DISPATCHER_IPP
#include
#include
@@ -25,9 +25,9 @@
#include
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/interface/http.hpp b/include/bitcoin/network/interface/http.hpp
index 03092b8a5..b99eec924 100644
--- a/include/bitcoin/network/interface/http.hpp
+++ b/include/bitcoin/network/interface/http.hpp
@@ -22,7 +22,7 @@
#include
#include
#include
-#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/interface/peer_broadcast.hpp b/include/bitcoin/network/interface/peer_broadcast.hpp
index 4957ab1b8..b243dce96 100644
--- a/include/bitcoin/network/interface/peer_broadcast.hpp
+++ b/include/bitcoin/network/interface/peer_broadcast.hpp
@@ -22,7 +22,7 @@
#include
#include
#include
-#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/interface/peer_dispatch.hpp b/include/bitcoin/network/interface/peer_dispatch.hpp
index c90ab64e8..7d6020c8f 100644
--- a/include/bitcoin/network/interface/peer_dispatch.hpp
+++ b/include/bitcoin/network/interface/peer_dispatch.hpp
@@ -22,7 +22,7 @@
#include
#include
#include
-#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/rpc/rpc.hpp b/include/bitcoin/network/messages/http/http.hpp
similarity index 62%
rename from include/bitcoin/network/rpc/rpc.hpp
rename to include/bitcoin/network/messages/http/http.hpp
index 0383a3a4c..4d56feae3 100644
--- a/include/bitcoin/network/rpc/rpc.hpp
+++ b/include/bitcoin/network/messages/http/http.hpp
@@ -16,17 +16,14 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_RPC_HPP
-#define LIBBITCOIN_NETWORK_RPC_RPC_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_HTTP_HTTP_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_HTTP_HTTP_HPP
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+ #include
+ #include
+ #include
+ #include
+ #include
+ #include
#endif
diff --git a/include/bitcoin/network/messages/monad_body.hpp b/include/bitcoin/network/messages/http_body.hpp
similarity index 87%
rename from include/bitcoin/network/messages/monad_body.hpp
rename to include/bitcoin/network/messages/http_body.hpp
index 6534571f9..2274d66ea 100644
--- a/include/bitcoin/network/messages/monad_body.hpp
+++ b/include/bitcoin/network/messages/http_body.hpp
@@ -16,35 +16,20 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_MESSAGES_MONAD_BODY_HPP
-#define LIBBITCOIN_NETWORK_MESSAGES_MONAD_BODY_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_HTTP_BODY_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_HTTP_BODY_HPP
#include
#include
#include
#include
-#include
-#include
+#include
#include
-#include
-
-// CYCLE
-#include
+#include
namespace libbitcoin {
namespace network {
-namespace rpc {
-
-using request_body = rpc::body;
-using response_body = rpc::body;
-
-} // rpc
-} // network
-} // libbitcoin
-
-namespace libbitcoin {
-namespace network {
-namespace monad {
+namespace http {
using empty_reader = http::empty_body::reader;
using data_reader = http::chunk_body::reader;
@@ -53,7 +38,6 @@ using span_reader = http::span_body::reader;
using buffer_reader = http::buffer_body::reader;
using string_reader = http::string_body::reader;
using json_reader = http::json_body::reader;
-using rpc_reader = rpc::request_body::reader;
using body_reader = std::variant
<
std::monostate,
@@ -64,7 +48,7 @@ using body_reader = std::variant
buffer_reader,
string_reader,
json_reader,
- rpc_reader
+ rpc::reader
>;
using empty_writer = http::empty_body::writer;
@@ -74,7 +58,6 @@ using span_writer = http::span_body::writer;
using buffer_writer = http::buffer_body::writer;
using string_writer = http::string_body::writer;
using json_writer = http::json_body::writer;
-using rpc_writer = rpc::response_body::writer;
using body_writer = std::variant
<
std::monostate,
@@ -85,7 +68,7 @@ using body_writer = std::variant
buffer_writer,
string_writer,
json_writer,
- rpc_writer
+ rpc::writer
>;
using empty_value = http::empty_body::value_type;
@@ -95,8 +78,6 @@ using span_value = http::span_body::value_type;
using buffer_value = http::buffer_body::value_type;
using string_value = http::string_body::value_type;
using json_value = http::json_body::value_type;
-using rpcin_value = rpc::request_body::value_type;
-using rpcout_value = rpc::response_body::value_type;
using body_value = std::variant
<
empty_value,
@@ -106,8 +87,8 @@ using body_value = std::variant
buffer_value,
string_value,
json_value,
- rpcin_value,
- rpcout_value
+ rpc::in_value,
+ rpc::out_value
>;
/// body template for all known message types.
@@ -136,8 +117,8 @@ struct BCT_API body
FORWARD_ALTERNATIVE_VARIANT_ASSIGNMENT(value_type, buffer_value, inner_)
FORWARD_ALTERNATIVE_VARIANT_ASSIGNMENT(value_type, string_value, inner_)
FORWARD_ALTERNATIVE_VARIANT_ASSIGNMENT(value_type, json_value, inner_)
- FORWARD_ALTERNATIVE_VARIANT_ASSIGNMENT(value_type, rpcin_value, inner_)
- FORWARD_ALTERNATIVE_VARIANT_ASSIGNMENT(value_type, rpcout_value, inner_)
+ FORWARD_ALTERNATIVE_VARIANT_ASSIGNMENT(value_type, rpc::in_value, inner_)
+ FORWARD_ALTERNATIVE_VARIANT_ASSIGNMENT(value_type, rpc::out_value, inner_)
inline bool has_value() const NOEXCEPT
{
@@ -200,7 +181,7 @@ struct BCT_API body
if (value_.plain_json)
value = json_value{};
else
- value = rpcin_value{};
+ value = rpc::in_value{};
break;
case http::media_type::text_plain:
value = string_value{};
@@ -221,7 +202,7 @@ struct BCT_API body
[&](std::monostate&) NOEXCEPT {},
[&](span_value&) NOEXCEPT {},
[&](buffer_value&) NOEXCEPT {},
- [&](rpcout_value&) NOEXCEPT {},
+ [&](rpc::out_value&) NOEXCEPT {},
[&](empty_value& value) NOEXCEPT
{
@@ -244,10 +225,10 @@ struct BCT_API body
// json_reader not copy or assignable (by contained parser).
reader_.emplace(header, value);
},
- [&](rpcin_value& value) NOEXCEPT
+ [&](rpc::in_value& value) NOEXCEPT
{
// json_reader not copy or assignable (by contained parser).
- reader_.emplace(header, value);
+ reader_.emplace(header, value);
}
}, value.value());
}
@@ -317,14 +298,14 @@ struct BCT_API body
return body_writer{ std::in_place_type,
header, value };
},
- [&](rpcout_value& value) NOEXCEPT
+ [&](rpc::out_value& value) NOEXCEPT
{
// json_writer is not movable (by contained serializer).
// So requires in-place construction for variant populate.
- return body_writer{ std::in_place_type,
+ return body_writer{ std::in_place_type,
header, value };
},
- [&](rpcin_value&) NOEXCEPT
+ [&](rpc::in_value&) NOEXCEPT
{
return body_writer{ std::monostate{} };
}
@@ -336,7 +317,7 @@ struct BCT_API body
};
};
-} // namespace monad
+} // namespace http
} // namespace network
} // namespace libbitcoin
@@ -344,10 +325,9 @@ namespace libbitcoin {
namespace network {
namespace http {
-using request = boost::beast::http::request;
+using request = boost::beast::http::request;
using request_cptr = std::shared_ptr;
-
-using response = boost::beast::http::response;
+using response = boost::beast::http::response;
using response_ptr = std::shared_ptr;
} // namespace http
diff --git a/include/bitcoin/network/messages/http/method.hpp b/include/bitcoin/network/messages/http_method.hpp
similarity index 94%
rename from include/bitcoin/network/messages/http/method.hpp
rename to include/bitcoin/network/messages/http_method.hpp
index 00a4b34b6..723815dc1 100644
--- a/include/bitcoin/network/messages/http/method.hpp
+++ b/include/bitcoin/network/messages/http_method.hpp
@@ -21,8 +21,7 @@
#include
#include
-#include
-#include
+#include
/// Type-differentiation for request message distribution.
diff --git a/include/bitcoin/network/messages/messages.hpp b/include/bitcoin/network/messages/messages.hpp
index 2f59e4c0e..ba074cb2a 100644
--- a/include/bitcoin/network/messages/messages.hpp
+++ b/include/bitcoin/network/messages/messages.hpp
@@ -19,16 +19,11 @@
#ifndef LIBBITCOIN_NETWORK_MESSAGES_MESSAGES_HPP
#define LIBBITCOIN_NETWORK_MESSAGES_MESSAGES_HPP
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
-#include
-#include
+#include
+#include
#endif
diff --git a/include/bitcoin/network/rpc/any.hpp b/include/bitcoin/network/messages/rpc/any.hpp
similarity index 97%
rename from include/bitcoin/network/rpc/any.hpp
rename to include/bitcoin/network/messages/rpc/any.hpp
index d3c857568..7420281fa 100644
--- a/include/bitcoin/network/rpc/any.hpp
+++ b/include/bitcoin/network/messages/rpc/any.hpp
@@ -16,8 +16,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_ANY_HPP
-#define LIBBITCOIN_NETWORK_RPC_ANY_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_ANY_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_ANY_HPP
#include
#include
diff --git a/include/bitcoin/network/messages/rpc_body.hpp b/include/bitcoin/network/messages/rpc/body.hpp
similarity index 89%
rename from include/bitcoin/network/messages/rpc_body.hpp
rename to include/bitcoin/network/messages/rpc/body.hpp
index 64ab57915..9a227bebf 100644
--- a/include/bitcoin/network/messages/rpc_body.hpp
+++ b/include/bitcoin/network/messages/rpc/body.hpp
@@ -21,6 +21,7 @@
#include
#include
+#include
namespace libbitcoin {
namespace network {
@@ -97,6 +98,14 @@ struct BCT_API body
};
};
+// Only defines that require model.hpp, could move to independent file.
+using request_body = body;
+using response_body = body;
+using in_value = request_body::value_type;
+using out_value = response_body::value_type;
+using reader = request_body::reader;
+using writer = response_body::writer;
+
} // namespace rpc
} // namespace network
} // namespace libbitcoin
diff --git a/include/bitcoin/network/rpc/broadcaster.hpp b/include/bitcoin/network/messages/rpc/broadcaster.hpp
similarity index 94%
rename from include/bitcoin/network/rpc/broadcaster.hpp
rename to include/bitcoin/network/messages/rpc/broadcaster.hpp
index 7d6264f8d..befca9efc 100644
--- a/include/bitcoin/network/rpc/broadcaster.hpp
+++ b/include/bitcoin/network/messages/rpc/broadcaster.hpp
@@ -16,13 +16,13 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_BROADCASTER_HPP
-#define LIBBITCOIN_NETWORK_RPC_BROADCASTER_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_BROADCASTER_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_BROADCASTER_HPP
#include
#include
#include
-#include
+#include
namespace libbitcoin {
namespace network {
@@ -99,7 +99,7 @@ class broadcaster
#define TEMPLATE template
#define CLASS broadcaster
-#include
+#include
#undef CLASS
#undef TEMPLATE
diff --git a/include/bitcoin/network/rpc/dispatcher.hpp b/include/bitcoin/network/messages/rpc/dispatcher.hpp
similarity index 95%
rename from include/bitcoin/network/rpc/dispatcher.hpp
rename to include/bitcoin/network/messages/rpc/dispatcher.hpp
index f86821a6b..3184a0631 100644
--- a/include/bitcoin/network/rpc/dispatcher.hpp
+++ b/include/bitcoin/network/messages/rpc/dispatcher.hpp
@@ -16,14 +16,14 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_DISPATCHER_HPP
-#define LIBBITCOIN_NETWORK_RPC_DISPATCHER_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_DISPATCHER_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_DISPATCHER_HPP
#include
#include
#include
-#include
-#include
+#include
+#include
namespace libbitcoin {
namespace network {
@@ -150,7 +150,7 @@ class dispatcher
#define TEMPLATE template
#define CLASS dispatcher
-#include
+#include
#undef CLASS
#undef TEMPLATE
diff --git a/include/bitcoin/network/rpc/enums/grouping.hpp b/include/bitcoin/network/messages/rpc/enums/grouping.hpp
similarity index 91%
rename from include/bitcoin/network/rpc/enums/grouping.hpp
rename to include/bitcoin/network/messages/rpc/enums/grouping.hpp
index c8b1a874b..cc217836b 100644
--- a/include/bitcoin/network/rpc/enums/grouping.hpp
+++ b/include/bitcoin/network/messages/rpc/enums/grouping.hpp
@@ -16,8 +16,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_ENUMS_GROUPING_HPP
-#define LIBBITCOIN_NETWORK_RPC_ENUMS_GROUPING_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_ENUMS_GROUPING_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_ENUMS_GROUPING_HPP
#include
diff --git a/include/bitcoin/network/rpc/enums/version.hpp b/include/bitcoin/network/messages/rpc/enums/version.hpp
similarity index 91%
rename from include/bitcoin/network/rpc/enums/version.hpp
rename to include/bitcoin/network/messages/rpc/enums/version.hpp
index 97c68a74b..d9a6d9e97 100644
--- a/include/bitcoin/network/rpc/enums/version.hpp
+++ b/include/bitcoin/network/messages/rpc/enums/version.hpp
@@ -16,8 +16,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_ENUMS_VERSION_HPP
-#define LIBBITCOIN_NETWORK_RPC_ENUMS_VERSION_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_ENUMS_VERSION_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_ENUMS_VERSION_HPP
#include
diff --git a/include/bitcoin/network/rpc/method.hpp b/include/bitcoin/network/messages/rpc/method.hpp
similarity index 97%
rename from include/bitcoin/network/rpc/method.hpp
rename to include/bitcoin/network/messages/rpc/method.hpp
index 316f62d83..d7276350e 100644
--- a/include/bitcoin/network/rpc/method.hpp
+++ b/include/bitcoin/network/messages/rpc/method.hpp
@@ -16,14 +16,14 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_METHOD_HPP
-#define LIBBITCOIN_NETWORK_RPC_METHOD_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_METHOD_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_METHOD_HPP
#include
#include
#include
#include
-#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/rpc/model.hpp b/include/bitcoin/network/messages/rpc/model.hpp
similarity index 96%
rename from include/bitcoin/network/rpc/model.hpp
rename to include/bitcoin/network/messages/rpc/model.hpp
index a6d30eb3f..33ad1725c 100644
--- a/include/bitcoin/network/rpc/model.hpp
+++ b/include/bitcoin/network/messages/rpc/model.hpp
@@ -16,16 +16,16 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_MODEL_HPP
-#define LIBBITCOIN_NETWORK_RPC_MODEL_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_MODEL_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_MODEL_HPP
#include
#include
#include
#include
#include
-#include
-#include
+#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/rpc/publish.hpp b/include/bitcoin/network/messages/rpc/publish.hpp
similarity index 87%
rename from include/bitcoin/network/rpc/publish.hpp
rename to include/bitcoin/network/messages/rpc/publish.hpp
index 20d88453b..c520efc22 100644
--- a/include/bitcoin/network/rpc/publish.hpp
+++ b/include/bitcoin/network/messages/rpc/publish.hpp
@@ -16,14 +16,14 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_PUBLISH_HPP
-#define LIBBITCOIN_NETWORK_RPC_PUBLISH_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_PUBLISH_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_PUBLISH_HPP
#include
#include
#include
-#include
-#include
+#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/messages/rpc/rpc.hpp b/include/bitcoin/network/messages/rpc/rpc.hpp
new file mode 100644
index 000000000..6e28c138e
--- /dev/null
+++ b/include/bitcoin/network/messages/rpc/rpc.hpp
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
+ *
+ * This file is part of libbitcoin.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_RPC_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_RPC_HPP
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/include/bitcoin/network/rpc/types.hpp b/include/bitcoin/network/messages/rpc/types.hpp
similarity index 98%
rename from include/bitcoin/network/rpc/types.hpp
rename to include/bitcoin/network/messages/rpc/types.hpp
index 1c3962912..5bd509303 100644
--- a/include/bitcoin/network/rpc/types.hpp
+++ b/include/bitcoin/network/messages/rpc/types.hpp
@@ -16,14 +16,14 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-#ifndef LIBBITCOIN_NETWORK_RPC_TYPES_HPP
-#define LIBBITCOIN_NETWORK_RPC_TYPES_HPP
+#ifndef LIBBITCOIN_NETWORK_MESSAGES_RPC_TYPES_HPP
+#define LIBBITCOIN_NETWORK_MESSAGES_RPC_TYPES_HPP
#include
#include
#include
#include
-#include
+#include
namespace libbitcoin {
namespace network {
diff --git a/include/bitcoin/network/net.hpp b/include/bitcoin/network/net.hpp
index 747788dc4..ff843ee0e 100644
--- a/include/bitcoin/network/net.hpp
+++ b/include/bitcoin/network/net.hpp
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#include
diff --git a/include/bitcoin/network/net/proxy.hpp b/include/bitcoin/network/net/proxy.hpp
index 7bdd13c66..a02130720 100644
--- a/include/bitcoin/network/net/proxy.hpp
+++ b/include/bitcoin/network/net/proxy.hpp
@@ -24,11 +24,11 @@
#include
#include
#include
+#include
#include
#include
#include
#include
-#include
namespace libbitcoin {
namespace network {
@@ -42,8 +42,6 @@ class BCT_API proxy
public:
typedef std::shared_ptr ptr;
typedef subscriber<> stop_subscriber;
- typedef rpc::request_body::value_type rpc_in_value;
- typedef rpc::response_body::value_type rpc_out_value;
DELETE_COPY_MOVE(proxy);
@@ -135,10 +133,10 @@ class BCT_API proxy
/// -----------------------------------------------------------------------
/// Read full rpc request from the socket, handler posted to socket strand.
- virtual void read(rpc_in_value& out, count_handler&& handler) NOEXCEPT;
+ virtual void read(rpc::in_value& out, count_handler&& handler) NOEXCEPT;
/// Write full rpc response to the socket, handler posted to socket strand.
- virtual void write(rpc_out_value&& in, count_handler&& handler) NOEXCEPT;
+ virtual void write(rpc::out_value&& in, count_handler&& handler) NOEXCEPT;
/// HTTP (generic).
/// -----------------------------------------------------------------------
diff --git a/include/bitcoin/network/net/socket.hpp b/include/bitcoin/network/net/socket.hpp
index de8baadf1..8755e5012 100644
--- a/include/bitcoin/network/net/socket.hpp
+++ b/include/bitcoin/network/net/socket.hpp
@@ -27,7 +27,6 @@
#include
#include
#include
-#include
namespace libbitcoin {
namespace network {
@@ -41,8 +40,6 @@ class BCT_API socket
{
public:
typedef std::shared_ptr ptr;
- typedef rpc::request_body::value_type rpc_in_value;
- typedef rpc::response_body::value_type rpc_out_value;
DELETE_COPY_MOVE(socket);
@@ -106,11 +103,11 @@ class BCT_API socket
/// -----------------------------------------------------------------------
/// Read full rpc request from the socket, handler posted to socket strand.
- virtual void rpc_read(rpc_in_value& request,
+ virtual void rpc_read(rpc::in_value& request,
count_handler&& handler) NOEXCEPT;
/// Write full rpc response to the socket, handler posted to socket strand.
- virtual void rpc_write(rpc_out_value&& response,
+ virtual void rpc_write(rpc::out_value&& response,
count_handler&& handler) NOEXCEPT;
/// HTTP (generic).
@@ -168,31 +165,29 @@ class BCT_API socket
struct read_rpc
{
typedef std::shared_ptr ptr;
- using rpc_reader = rpc::request_body::reader;
- read_rpc(rpc_in_value& request_) NOEXCEPT
+ read_rpc(rpc::in_value& request_) NOEXCEPT
: value{}, reader{ value }
{
request_ = value;
}
- rpc_in_value value;
- rpc_reader reader;
+ rpc::in_value value;
+ rpc::reader reader;
};
struct write_rpc
{
typedef std::shared_ptr ptr;
- using rpc_writer = rpc::response_body::writer;
- using out_buffer = rpc_writer::out_buffer;
+ using out_buffer = rpc::writer::out_buffer;
- write_rpc(rpc_out_value&& response) NOEXCEPT
+ write_rpc(rpc::out_value&& response) NOEXCEPT
: value{ std::move(response) }, writer{ value }
{
}
- rpc_out_value value;
- rpc_writer writer;
+ rpc::out_value value;
+ rpc::writer writer;
};
// stop
diff --git a/include/bitcoin/network/sessions/session.hpp b/include/bitcoin/network/sessions/session.hpp
index 10df5a37b..b7ad69ea3 100644
--- a/include/bitcoin/network/sessions/session.hpp
+++ b/include/bitcoin/network/sessions/session.hpp
@@ -30,7 +30,6 @@
#include
#include
#include
-#include
#include
namespace libbitcoin {
diff --git a/src/channels/channel_http.cpp b/src/channels/channel_http.cpp
index e9572ce3d..20e19fc4a 100644
--- a/src/channels/channel_http.cpp
+++ b/src/channels/channel_http.cpp
@@ -25,7 +25,6 @@
#include
#include
#include
-#include
namespace libbitcoin {
namespace network {
@@ -117,7 +116,7 @@ void channel_http::handle_receive(const code& ec, size_t,
dispatch(request);
}
-// Wrap the monad request as a tagged verb request and dispatch by type.
+// Wrap the http request as a tagged verb request and dispatch by type.
void channel_http::dispatch(const request_cptr& request) NOEXCEPT
{
request_t model{};
@@ -179,11 +178,11 @@ void channel_http::handle_send(const code& ec, size_t, response_ptr&,
void channel_http::assign_json_buffer(response& response) NOEXCEPT
{
if (const auto& body = response.body();
- body.contains())
+ body.contains