Commit cb5276a2 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[master] Merge branch 'trac5580'

parents 5d0f9963 9b44014d
// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
// //
// This Source Code Form is subject to the terms of the Mozilla Public // This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this // License, v. 2.0. If a copy of the MPL was not distributed with this
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <asiolink/asio_wrapper.h> #include <asiolink/asio_wrapper.h>
#include <asiolink/unix_domain_socket.h> #include <asiolink/unix_domain_socket.h>
#include <boost/bind.hpp>
#include <boost/enable_shared_from_this.hpp> #include <boost/enable_shared_from_this.hpp>
#include <iostream> #include <iostream>
using namespace boost::asio::local; using namespace boost::asio::local;
...@@ -161,10 +162,7 @@ public: ...@@ -161,10 +162,7 @@ public:
void void
UnixDomainSocketImpl::asyncConnect(const stream_protocol::endpoint& endpoint, UnixDomainSocketImpl::asyncConnect(const stream_protocol::endpoint& endpoint,
const UnixDomainSocket::ConnectHandler& handler) { const UnixDomainSocket::ConnectHandler& handler) {
using namespace std::placeholders; auto local_handler = boost::bind(&UnixDomainSocketImpl::connectHandler, shared_from_this(),
UnixDomainSocket::ConnectHandler local_handler =
std::bind(&UnixDomainSocketImpl::connectHandler, shared_from_this(),
handler, _1); handler, _1);
socket_.async_connect(endpoint, local_handler); socket_.async_connect(endpoint, local_handler);
} }
...@@ -193,10 +191,7 @@ UnixDomainSocketImpl::asyncSend(const void* data, const size_t length, ...@@ -193,10 +191,7 @@ UnixDomainSocketImpl::asyncSend(const void* data, const size_t length,
void void
UnixDomainSocketImpl::doSend(const boost::asio::const_buffers_1& buffer, UnixDomainSocketImpl::doSend(const boost::asio::const_buffers_1& buffer,
const UnixDomainSocket::Handler& handler) { const UnixDomainSocket::Handler& handler) {
using namespace std::placeholders; auto local_handler = boost::bind(&UnixDomainSocketImpl::sendHandler, shared_from_this(),
UnixDomainSocket::Handler local_handler =
std::bind(&UnixDomainSocketImpl::sendHandler, shared_from_this(),
handler, buffer, _1, _2); handler, buffer, _1, _2);
socket_.async_send(buffer, local_handler); socket_.async_send(buffer, local_handler);
} }
...@@ -228,10 +223,7 @@ UnixDomainSocketImpl::asyncReceive(void* data, const size_t length, ...@@ -228,10 +223,7 @@ UnixDomainSocketImpl::asyncReceive(void* data, const size_t length,
void void
UnixDomainSocketImpl::doReceive(const boost::asio::mutable_buffers_1& buffer, UnixDomainSocketImpl::doReceive(const boost::asio::mutable_buffers_1& buffer,
const UnixDomainSocket::Handler& handler) { const UnixDomainSocket::Handler& handler) {
using namespace std::placeholders; auto local_handler = boost::bind(&UnixDomainSocketImpl::receiveHandler, shared_from_this(),
UnixDomainSocket::Handler local_handler =
std::bind(&UnixDomainSocketImpl::receiveHandler, shared_from_this(),
handler, buffer, _1, _2); handler, buffer, _1, _2);
socket_.async_receive(buffer, 0, local_handler); socket_.async_receive(buffer, 0, local_handler);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment