summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/socket_pdu_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/lib/socket_pdu_impl.cc')
-rw-r--r--gr-blocks/lib/socket_pdu_impl.cc20
1 files changed, 8 insertions, 12 deletions
diff --git a/gr-blocks/lib/socket_pdu_impl.cc b/gr-blocks/lib/socket_pdu_impl.cc
index 14dc124e63..bdbe1eb2d2 100644
--- a/gr-blocks/lib/socket_pdu_impl.cc
+++ b/gr-blocks/lib/socket_pdu_impl.cc
@@ -88,9 +88,8 @@ socket_pdu_impl::socket_pdu_impl(std::string type,
start_tcp_accept();
- set_msg_handler(
- pdu::pdu_port_id(),
- std::bind(&socket_pdu_impl::tcp_server_send, this, std::placeholders::_1));
+ set_msg_handler(pdu::pdu_port_id(),
+ [this](pmt::pmt_t msg) { this->tcp_server_send(msg); });
} else if (type == "TCP_CLIENT") {
boost::system::error_code error = boost::asio::error::host_not_found;
d_tcp_socket.reset(new boost::asio::ip::tcp::socket(d_io_service));
@@ -99,9 +98,8 @@ socket_pdu_impl::socket_pdu_impl(std::string type,
throw boost::system::system_error(error);
d_tcp_socket->set_option(boost::asio::ip::tcp::no_delay(d_tcp_no_delay));
- set_msg_handler(
- pdu::pdu_port_id(),
- std::bind(&socket_pdu_impl::tcp_client_send, this, std::placeholders::_1));
+ set_msg_handler(pdu::pdu_port_id(),
+ [this](pmt::pmt_t msg) { this->tcp_client_send(msg); });
d_tcp_socket->async_read_some(
boost::asio::buffer(d_rxbuf),
@@ -120,9 +118,8 @@ socket_pdu_impl::socket_pdu_impl(std::string type,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
- set_msg_handler(
- pdu::pdu_port_id(),
- std::bind(&socket_pdu_impl::udp_send, this, std::placeholders::_1));
+ set_msg_handler(pdu::pdu_port_id(),
+ [this](pmt::pmt_t msg) { this->udp_send(msg); });
} else if (type == "UDP_CLIENT") {
d_udp_socket.reset(
new boost::asio::ip::udp::socket(d_io_service, d_udp_endpoint));
@@ -134,9 +131,8 @@ socket_pdu_impl::socket_pdu_impl(std::string type,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
- set_msg_handler(
- pdu::pdu_port_id(),
- std::bind(&socket_pdu_impl::udp_send, this, std::placeholders::_1));
+ set_msg_handler(pdu::pdu_port_id(),
+ [this](pmt::pmt_t msg) { this->udp_send(msg); });
} else
throw std::runtime_error("gr::blocks:socket_pdu: unknown socket type");