Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29ec7e2

Browse files
committed
Renamed base class connection to async_connection.
1 parentb02948f commit29ec7e2

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

‎http/src/network/http/v2/client/connection/connection.hpp‎renamed to ‎http/src/network/http/v2/client/connection/async_connection.hpp‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// (See accompanying file LICENSE_1_0.txt or copy at
44
// http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndefNETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC
7-
#defineNETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC
6+
#ifndefNETWORK_HTTP_V2_CLIENT_CONNECTION_ASYNC_CONNECTION_INC
7+
#defineNETWORK_HTTP_V2_CLIENT_CONNECTION_ASYNC_CONNECTION_INC
88

99
#include<functional>
1010
#include<string>
@@ -17,13 +17,13 @@ namespace network {
1717
namespacehttp {
1818
namespacev2 {
1919
/**
20-
* \classconnection network/http/v2/client/connection/connection.hpp
20+
* \classasync_connection network/http/v2/client/connection/async_connection.hpp
2121
* \brief Manages a connection through a socket.
2222
*/
23-
classconnection {
23+
classasync_connection {
2424

25-
connection(constconnection &) =delete;
26-
connection &operator = (constconnection &) =delete;
25+
async_connection(constasync_connection &) =delete;
26+
async_connection &operator = (constasync_connection &) =delete;
2727

2828
public:
2929

@@ -45,12 +45,12 @@ namespace network {
4545
/**
4646
* \brief Constructor.
4747
*/
48-
connection() =default;
48+
async_connection() =default;
4949

5050
/**
5151
* \brief Destructor.
5252
*/
53-
virtual~connection()noexcept { }
53+
virtual~async_connection()noexcept { }
5454

5555
/**
5656
* \brief Asynchronously creates a connection to an endpoint.
@@ -88,4 +88,4 @@ namespace network {
8888
}// namespace http
8989
}// namespace network
9090

91-
#endif//NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC
91+
#endif//NETWORK_HTTP_V2_CLIENT_CONNECTION_ASYNC_CONNECTION_INC

‎http/src/network/http/v2/client/connection/normal_connection.hpp‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
#include<boost/asio/ip/tcp.hpp>
1212
#include<boost/asio/io_service.hpp>
1313
#include<network/config.hpp>
14-
#include<network/http/v2/client/connection/connection.hpp>
14+
#include<network/http/v2/client/connection/async_connection.hpp>
1515

1616
namespacenetwork {
1717
namespacehttp {
1818
namespacev2 {
19-
classnormal_connection :publicconnection {
19+
classnormal_connection :publicasync_connection {
2020

2121
normal_connection(const normal_connection &) =delete;
2222
normal_connection &operator = (const normal_connection &) =delete;
@@ -35,11 +35,8 @@ namespace network {
3535
virtualvoidasync_connect(const boost::asio::ip::tcp::endpoint &endpoint,
3636
connect_callback callback) {
3737
using boost::asio::ip::tcp;
38-
std::cout <<"Oh 1." << std::endl;
3938
socket_.reset(new tcp::socket{io_service_});
40-
std::cout <<"Oh 2." << std::endl;
4139
socket_->async_connect(endpoint, callback);
42-
std::cout <<"Oh 3." << std::endl;
4340
}
4441

4542
virtualvoidasync_write(boost::asio::streambuf &command_streambuf,

‎http/test/v2/features/client/normal_connection_test.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Describe(normal_http_connection) {
111111

112112
std::unique_ptr<boost::asio::io_service> io_service_;
113113
std::unique_ptr<tcp::resolver> resolver_;
114-
std::unique_ptr<http::connection> connection_;
114+
std::unique_ptr<http::async_connection> connection_;
115115

116116
boost::asio::streambuf request_;
117117
boost::asio::streambuf response_;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp