Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / asio / detail / socket_select_interrupter.hpp @ 2486

History | View | Annotate | Download (2.6 kB)

1 2486 sjacqu01
//
2 2486 sjacqu01
// detail/socket_select_interrupter.hpp
3 2486 sjacqu01
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 2486 sjacqu01
//
5 2486 sjacqu01
// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 2486 sjacqu01
//
7 2486 sjacqu01
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8 2486 sjacqu01
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 2486 sjacqu01
//
10 2486 sjacqu01
11 2486 sjacqu01
#ifndef BOOST_ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP
12 2486 sjacqu01
#define BOOST_ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP
13 2486 sjacqu01
14 2486 sjacqu01
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 2486 sjacqu01
# pragma once
16 2486 sjacqu01
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 2486 sjacqu01
18 2486 sjacqu01
#include <boost/asio/detail/config.hpp>
19 2486 sjacqu01
20 2486 sjacqu01
#if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
21 2486 sjacqu01
22 2486 sjacqu01
#if defined(BOOST_ASIO_WINDOWS) \
23 2486 sjacqu01
  || defined(__CYGWIN__) \
24 2486 sjacqu01
  || defined(__SYMBIAN32__)
25 2486 sjacqu01
26 2486 sjacqu01
#include <boost/asio/detail/socket_types.hpp>
27 2486 sjacqu01
28 2486 sjacqu01
#include <boost/asio/detail/push_options.hpp>
29 2486 sjacqu01
30 2486 sjacqu01
namespace boost {
31 2486 sjacqu01
namespace asio {
32 2486 sjacqu01
namespace detail {
33 2486 sjacqu01
34 2486 sjacqu01
class socket_select_interrupter
35 2486 sjacqu01
{
36 2486 sjacqu01
public:
37 2486 sjacqu01
  // Constructor.
38 2486 sjacqu01
  BOOST_ASIO_DECL socket_select_interrupter();
39 2486 sjacqu01
40 2486 sjacqu01
  // Destructor.
41 2486 sjacqu01
  BOOST_ASIO_DECL ~socket_select_interrupter();
42 2486 sjacqu01
43 2486 sjacqu01
  // Recreate the interrupter's descriptors. Used after a fork.
44 2486 sjacqu01
  BOOST_ASIO_DECL void recreate();
45 2486 sjacqu01
46 2486 sjacqu01
  // Interrupt the select call.
47 2486 sjacqu01
  BOOST_ASIO_DECL void interrupt();
48 2486 sjacqu01
49 2486 sjacqu01
  // Reset the select interrupt. Returns true if the call was interrupted.
50 2486 sjacqu01
  BOOST_ASIO_DECL bool reset();
51 2486 sjacqu01
52 2486 sjacqu01
  // Get the read descriptor to be passed to select.
53 2486 sjacqu01
  socket_type read_descriptor() const
54 2486 sjacqu01
  {
55 2486 sjacqu01
    return read_descriptor_;
56 2486 sjacqu01
  }
57 2486 sjacqu01
58 2486 sjacqu01
private:
59 2486 sjacqu01
  // Open the descriptors. Throws on error.
60 2486 sjacqu01
  BOOST_ASIO_DECL void open_descriptors();
61 2486 sjacqu01
62 2486 sjacqu01
  // Close the descriptors.
63 2486 sjacqu01
  BOOST_ASIO_DECL void close_descriptors();
64 2486 sjacqu01
65 2486 sjacqu01
  // The read end of a connection used to interrupt the select call. This file
66 2486 sjacqu01
  // descriptor is passed to select such that when it is time to stop, a single
67 2486 sjacqu01
  // byte will be written on the other end of the connection and this
68 2486 sjacqu01
  // descriptor will become readable.
69 2486 sjacqu01
  socket_type read_descriptor_;
70 2486 sjacqu01
71 2486 sjacqu01
  // The write end of a connection used to interrupt the select call. A single
72 2486 sjacqu01
  // byte may be written to this to wake up the select which is waiting for the
73 2486 sjacqu01
  // other end to become readable.
74 2486 sjacqu01
  socket_type write_descriptor_;
75 2486 sjacqu01
};
76 2486 sjacqu01
77 2486 sjacqu01
} // namespace detail
78 2486 sjacqu01
} // namespace asio
79 2486 sjacqu01
} // namespace boost
80 2486 sjacqu01
81 2486 sjacqu01
#include <boost/asio/detail/pop_options.hpp>
82 2486 sjacqu01
83 2486 sjacqu01
#if defined(BOOST_ASIO_HEADER_ONLY)
84 2486 sjacqu01
# include <boost/asio/detail/impl/socket_select_interrupter.ipp>
85 2486 sjacqu01
#endif // defined(BOOST_ASIO_HEADER_ONLY)
86 2486 sjacqu01
87 2486 sjacqu01
#endif // defined(BOOST_ASIO_WINDOWS)
88 2486 sjacqu01
       // || defined(__CYGWIN__)
89 2486 sjacqu01
       // || defined(__SYMBIAN32__)
90 2486 sjacqu01
91 2486 sjacqu01
#endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
92 2486 sjacqu01
93 2486 sjacqu01
#endif // BOOST_ASIO_DETAIL_SOCKET_SELECT_INTERRUPTER_HPP