File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 33
33
34
34
using namespace std ::literals;
35
35
36
- constexpr boost::asio::string_view c_host { " 127.0.0.1" };
37
- constexpr boost::asio::string_view c_port { " 8080" };
38
- constexpr boost::asio::string_view c_target { " /graphql" };
39
- constexpr int c_version = 11 ; // HTTP 1.1
40
-
41
36
using namespace graphql ;
42
37
43
38
namespace beast = boost::beast;
44
39
namespace http = beast::http;
45
40
namespace net = boost::asio;
46
41
using tcp = boost::asio::ip::tcp;
47
42
43
+ constexpr net::string_view c_host { " 127.0.0.1" };
44
+ constexpr net::string_view c_port { " 8080" };
45
+ constexpr net::string_view c_target { " /graphql" };
46
+ constexpr int c_version = 11 ; // HTTP 1.1
47
+
48
48
class Query
49
49
{
50
50
public:
@@ -95,9 +95,9 @@ std::future<std::string> Query::getRelay(std::string&& queryArg,
95
95
net::io_context ioc;
96
96
auto future = net::co_spawn (
97
97
ioc,
98
- [](std ::string_view host,
99
- std ::string_view port,
100
- std ::string_view target,
98
+ [](net ::string_view host,
99
+ net ::string_view port,
100
+ net ::string_view target,
101
101
int version,
102
102
std::string requestBody) -> net::awaitable<std::string> {
103
103
// These objects perform our I/O. They use an executor with a default completion token
Original file line number Diff line number Diff line change 36
36
37
37
using namespace std ::literals;
38
38
39
- constexpr boost::asio::string_view c_host { " 127.0.0.1" };
40
- constexpr unsigned short c_port = 8080 ;
41
- constexpr boost::asio::string_view c_target { " /graphql" };
42
-
43
39
using namespace graphql ;
44
40
45
41
namespace beast = boost::beast;
@@ -50,6 +46,10 @@ using tcp = boost::asio::ip::tcp;
50
46
using tcp_stream = typename beast::tcp_stream::rebind_executor<
51
47
net::use_awaitable_t <>::executor_with_default<net::any_io_executor>>::other;
52
48
49
+ constexpr net::string_view c_host { " 127.0.0.1" };
50
+ constexpr unsigned short c_port = 8080 ;
51
+ constexpr net::string_view c_target { " /graphql" };
52
+
53
53
// Based on:
54
54
// https://www.boost.org/doc/libs/1_82_0/libs/beast/example/http/server/awaitable/http_server_awaitable.cpp
55
55
int main ()
You can’t perform that action at this time.
0 commit comments