$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] UDP: socket::open does not take an endpoint
From: Chris Stankevitz (chrisstankevitz_at_[hidden])
Date: 2013-05-08 16:01:06
Hello,
boost::asio::ip::udp::socket offers two ways to open:
a) pass io_service and endpoint to the socket::socket
b) pass io_service to socket::socket, then call socket::open
===
The UDP async server example uses method (a):
boost::asio::ip::udp::socket Socket(
IoService,
boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 13));
===
Question 1:
Why doesn't boost UDP allow me to use method (b) with an endpoint?
For example, this is impossible:
boost::asio::ip::udp::socket Socket(IoService);
Socket.open(boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 13));
// error: open does not take a boost::asio::ip::udp::endpoint
===
Question 2:
How can I modify the UDP async server example to use method (b)?
Thank you,
Chris