did you actually read the question (the 1st post in the forum under
this topic)? I have written the code explicitly there:
if(!m_udpSocket.is_open())
{
m_udpSocket.open(m_localEndpoint.protocol(), errorCode);
//m_localEndpoint is address 0.0.0.0 and port X
if(errorCode)
{
std::cerr << "Unable to open socket: " << errorCode.message()
<< std::endl;
}
else
{
m_udpSocket.set_option(boost::asio::socket_base::reuse_address(true),
errorCode);
if(errorCode)
{
std::cerr << "Reuse address option set failure. " <<
errorCode.message() << std::endl;
}
m_udpSocket.set_option(boost::asio::socket_base::broadcast(true),
errorCode);
if(errorCode)
{
std::cerr << "Socket cannot send broadcast. " <<
errorCode.message() << std::endl;
}
else
{
m_udpSocket.bind(m_localEndpoint, errorCode);
if(errorCode)
{
std::cerr << "Socket cannot bind...!! " <<
errorCode.message() << std::endl;
}
}
}
}
Do you mean there's anything wrong with this?
On Mon, Jan 13, 2014 at 11:42 PM, Cliff Green-3 [via Boost]
<[hidden email]> wrote: