Skip to content

Commit 29ec7e2

Browse files
committed
Renamed base class connection to async_connection.
1 parent b02948f commit 29ec7e2

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-
#ifndef NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC
7-
#define NETWORK_HTTP_V2_CLIENT_CONNECTION_CONNECTION_INC
6+
#ifndef NETWORK_HTTP_V2_CLIENT_CONNECTION_ASYNC_CONNECTION_INC
7+
#define NETWORK_HTTP_V2_CLIENT_CONNECTION_ASYNC_CONNECTION_INC
88

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

25-
connection(const connection &) = delete;
26-
connection &operator = (const connection &) = delete;
25+
async_connection(const async_connection &) = delete;
26+
async_connection &operator = (const async_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
namespace network {
1717
namespace http {
1818
namespace v2 {
19-
class normal_connection : public connection {
19+
class normal_connection : public async_connection {
2020

2121
normal_connection(const normal_connection &) = delete;
2222
normal_connection &operator = (const normal_connection &) = delete;
@@ -35,11 +35,8 @@ namespace network {
3535
virtual void async_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
virtual void async_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)