Boost logo

Boost Users :

Subject: [Boost-users] boost asio: Probelm with closing a blocking ip::udp::socket receive
From: Lennyk (lennyk430_at_[hidden])
Date: 2009-03-12 09:06:35


Hi,

I'm using boost 1.35 on Linux.
I have a thread which initiates a ip::udp::socket and has a blocking
receive.
When I try to terminate this thread from a different thread, in order to
close the udp::socket I use the following:

// m_socket is of type ip::udp::socket
boost::system::error_code ec;
m_socket::shutdown(boost::asio::ip::udp::socket::shutdown_receive, ec);
std::cout << "error code = " << ec << std::endl;
m_socket.close();

After shutdown I ALWAYS get system:107 error code - which means
"Transport endpoint is not connected".

Does anybody have any idea why I'm receiving such an error?
Needless to say, the receive is working great - and I get the packets
from the port I'm listening to.

Thanks!


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net