summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/impl/socket_select_interrupter.ipp')
-rw-r--r--3rdParty/Boost/src/boost/asio/detail/impl/socket_select_interrupter.ipp22
1 files changed, 21 insertions, 1 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/impl/socket_select_interrupter.ipp b/3rdParty/Boost/src/boost/asio/detail/impl/socket_select_interrupter.ipp
index 3b64771..6005f12 100644
--- a/3rdParty/Boost/src/boost/asio/detail/impl/socket_select_interrupter.ipp
+++ b/3rdParty/Boost/src/boost/asio/detail/impl/socket_select_interrupter.ipp
@@ -2,7 +2,7 @@
// detail/impl/socket_select_interrupter.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -36,6 +36,11 @@ namespace detail {
socket_select_interrupter::socket_select_interrupter()
{
+ open_descriptors();
+}
+
+void socket_select_interrupter::open_descriptors()
+{
boost::system::error_code ec;
socket_holder acceptor(socket_ops::socket(
AF_INET, SOCK_STREAM, IPPROTO_TCP, ec));
@@ -110,6 +115,11 @@ socket_select_interrupter::socket_select_interrupter()
socket_select_interrupter::~socket_select_interrupter()
{
+ close_descriptors();
+}
+
+void socket_select_interrupter::close_descriptors()
+{
boost::system::error_code ec;
socket_ops::state_type state = socket_ops::internal_non_blocking;
if (read_descriptor_ != invalid_socket)
@@ -118,6 +128,16 @@ socket_select_interrupter::~socket_select_interrupter()
socket_ops::close(write_descriptor_, state, true, ec);
}
+void socket_select_interrupter::recreate()
+{
+ close_descriptors();
+
+ write_descriptor_ = invalid_socket;
+ read_descriptor_ = invalid_socket;
+
+ open_descriptors();
+}
+
void socket_select_interrupter::interrupt()
{
char byte = 0;