Skip to content

Commit

Permalink
first pass at Boost 1.70 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Sep 3, 2019
1 parent 0df2ec8 commit 33c2c42
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
6 changes: 4 additions & 2 deletions src/cpp/core/include/core/http/TcpIpAsyncConnector.hpp
Expand Up @@ -55,7 +55,8 @@ class TcpIpAsyncConnector :
public:
TcpIpAsyncConnector(boost::asio::io_service& ioService,
boost::asio::ip::tcp::socket* pSocket)
: pSocket_(pSocket),
: service_(ioService),
pSocket_(pSocket),
resolver_(ioService),
isConnected_(false),
hasFailed_(false)
Expand All @@ -78,7 +79,7 @@ class TcpIpAsyncConnector :
{
// start a timer that will cancel any outstanding asynchronous operations
// when it elapses if the connection operation has not succeeded
pConnectionTimer_.reset(new boost::asio::deadline_timer(resolver_.get_io_service(), timeout));
pConnectionTimer_.reset(new boost::asio::deadline_timer(service_, timeout));
pConnectionTimer_->async_wait(boost::bind(&TcpIpAsyncConnector::onConnectionTimeout,
TcpIpAsyncConnector::shared_from_this(),
boost::asio::placeholders::error));
Expand Down Expand Up @@ -233,6 +234,7 @@ class TcpIpAsyncConnector :
}

private:
boost::asio::io_service& service_;
boost::asio::ip::tcp::socket* pSocket_;
boost::asio::ip::tcp::resolver resolver_;
ConnectedHandler connectedHandler_;
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/ext/websocketpp/transport/asio/connection.hpp
Expand Up @@ -296,7 +296,7 @@ class connection : public config::socket_type::socket_con_type {
*/
timer_ptr set_timer(long duration, timer_handler callback) {
timer_ptr new_timer = lib::make_shared<boost::asio::deadline_timer>(
lib::ref(*m_io_service),
*m_io_service,
boost::posix_time::milliseconds(duration)
);

Expand Down
10 changes: 3 additions & 7 deletions src/cpp/ext/websocketpp/transport/asio/endpoint.hpp
Expand Up @@ -183,8 +183,7 @@ class endpoint : public config::socket_type {

m_io_service = ptr;
m_external_io_service = true;
m_acceptor = lib::make_shared<boost::asio::ip::tcp::acceptor>(
lib::ref(*m_io_service));
m_acceptor = lib::make_shared<boost::asio::ip::tcp::acceptor>(*m_io_service);

m_state = READY;
ec = lib::error_code();
Expand Down Expand Up @@ -609,9 +608,7 @@ class endpoint : public config::socket_type {
* @since 0.3.0
*/
void start_perpetual() {
m_work = lib::make_shared<boost::asio::io_service::work>(
lib::ref(*m_io_service)
);
m_work = lib::make_shared<boost::asio::io_service::work>(*m_io_service);
}

/// Clears the endpoint's perpetual flag, allowing it to exit when empty
Expand Down Expand Up @@ -775,8 +772,7 @@ class endpoint : public config::socket_type {

// Create a resolver
if (!m_resolver) {
m_resolver = lib::make_shared<boost::asio::ip::tcp::resolver>(
lib::ref(*m_io_service));
m_resolver = lib::make_shared<boost::asio::ip::tcp::resolver>(*m_io_service);
}

std::string proxy = tcon->get_proxy();
Expand Down
3 changes: 1 addition & 2 deletions src/cpp/ext/websocketpp/transport/asio/security/none.hpp
Expand Up @@ -166,8 +166,7 @@ class connection : public lib::enable_shared_from_this<connection> {
return socket::make_error_code(socket::error::invalid_state);
}

m_socket = lib::make_shared<boost::asio::ip::tcp::socket>(
lib::ref(*service));
m_socket = lib::make_shared<boost::asio::ip::tcp::socket>(*service);

m_state = READY;

Expand Down

0 comments on commit 33c2c42

Please sign in to comment.