passenger 5.1.12 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG +18 -1
- data/Rakefile +4 -1
- data/build/agent.rb +2 -2
- data/build/apache2.rb +17 -10
- data/build/basics.rb +18 -4
- data/build/common_library.rb +7 -3
- data/build/cxx_tests.rb +2 -7
- data/build/misc.rb +3 -1
- data/build/nginx.rb +11 -5
- data/build/oxt_tests.rb +0 -3
- data/build/packaging.rb +3 -2
- data/build/schema_printer.rb +103 -0
- data/build/support/cplusplus.rb +2 -2
- data/build/support/cxx_dependency_map.rb +2575 -868
- data/dev/ci/lib/functions.sh +1 -1
- data/dev/ci/lib/set-container-envvars.sh +1 -1
- data/dev/ci/lib/setup-container.sh +1 -1
- data/dev/ci/run-tests-natively +1 -1
- data/dev/ci/run-tests-with-docker +1 -1
- data/dev/ci/scripts/debug-console-wrapper.sh +1 -1
- data/dev/ci/scripts/docker-entrypoint-stage2.sh +1 -1
- data/dev/ci/scripts/docker-entrypoint.sh +1 -1
- data/dev/ci/scripts/inituidgid +1 -1
- data/dev/ci/scripts/run-tests-natively-stage2.sh +1 -1
- data/dev/ci/scripts/setup-host-natively.sh +1 -1
- data/dev/ci/setup-host +1 -1
- data/dev/ci/tests/apache2/run +1 -1
- data/dev/ci/tests/apache2/setup +1 -1
- data/dev/ci/tests/cxx/run +1 -1
- data/dev/ci/tests/cxx/setup +1 -1
- data/dev/ci/tests/debian/Jenkinsfile +0 -1
- data/dev/ci/tests/debian/run +1 -1
- data/dev/ci/tests/nginx-dynamic/run +1 -1
- data/dev/ci/tests/nginx-dynamic/setup +1 -1
- data/dev/ci/tests/nginx/run +1 -1
- data/dev/ci/tests/nginx/setup +1 -1
- data/dev/ci/tests/nodejs/run +1 -1
- data/dev/ci/tests/nodejs/setup +1 -1
- data/dev/ci/tests/rpm/run +1 -1
- data/dev/ci/tests/ruby/run +1 -1
- data/dev/ci/tests/ruby/setup +1 -1
- data/dev/ci/tests/source-packaging/run +1 -1
- data/dev/ci/tests/source-packaging/setup +1 -1
- data/dev/ci/tests/standalone/run +1 -1
- data/dev/ci/tests/standalone/setup +1 -1
- data/dev/configkit-schemas/index.json +1708 -0
- data/dev/configkit-schemas/update_schema_inline_comments.rb +118 -0
- data/dev/copy_boost_headers +13 -1
- data/dev/index_cxx_dependencies.rb +20 -7
- data/dev/vagrant/provision.sh +1 -1
- data/resources/mime.types +1 -0
- data/resources/templates/standalone/http.erb +1 -6
- data/src/agent/Core/AdminPanelConnector.h +550 -0
- data/src/agent/Core/ApiServer.h +159 -97
- data/src/agent/Core/ApplicationPool/Group.h +2 -0
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +3 -2
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +109 -0
- data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -3
- data/src/agent/Core/ApplicationPool/Options.h +5 -6
- data/src/agent/Core/ApplicationPool/Pool.h +59 -2
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +3 -3
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +6 -0
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +129 -0
- data/src/agent/Core/Config.h +475 -0
- data/src/agent/Core/ConfigChange.cpp +349 -0
- data/src/agent/Core/ConfigChange.h +54 -0
- data/src/agent/Core/Controller.h +35 -3
- data/src/agent/Core/Controller/CheckoutSession.cpp +1 -1
- data/src/agent/Core/Controller/Config.cpp +0 -2
- data/src/agent/Core/Controller/Config.h +168 -104
- data/src/agent/Core/Controller/ForwardResponse.cpp +1 -1
- data/src/agent/Core/Controller/InitRequest.cpp +14 -15
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +34 -44
- data/src/agent/Core/Controller/Request.h +0 -1
- data/src/agent/Core/CoreMain.cpp +236 -349
- data/src/agent/Core/OptionParser.h +75 -89
- data/src/agent/Core/SecurityUpdateChecker.h +263 -100
- data/src/agent/Core/SpawningKit/Config.h +6 -2
- data/src/agent/Core/SpawningKit/Spawner.h +0 -45
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +1 -0
- data/src/agent/Shared/ApiAccountUtils.h +318 -0
- data/src/agent/Shared/ApiServerUtils.h +3 -104
- data/src/agent/Shared/Fundamentals/Initialization.cpp +81 -44
- data/src/agent/Shared/Fundamentals/Initialization.h +12 -7
- data/src/agent/TempDirToucher/TempDirToucherMain.cpp +21 -0
- data/src/agent/Watchdog/AgentWatcher.cpp +1 -1
- data/src/agent/Watchdog/ApiServer.h +100 -14
- data/src/agent/Watchdog/Config.h +340 -0
- data/src/agent/Watchdog/CoreWatcher.cpp +27 -13
- data/src/agent/Watchdog/InstanceDirToucher.cpp +1 -1
- data/src/agent/Watchdog/WatchdogMain.cpp +190 -206
- data/src/apache2_module/Bucket.cpp +4 -0
- data/src/apache2_module/Bucket.h +7 -3
- data/src/apache2_module/CBindings.cpp +49 -0
- data/src/apache2_module/Config.cpp +242 -0
- data/src/apache2_module/Config.h +109 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +485 -0
- data/src/apache2_module/{ConfigurationCommands.cpp.cxxcodebuilder → ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder} +29 -15
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +298 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp.cxxcodebuilder +171 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +854 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +188 -0
- data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +610 -0
- data/src/apache2_module/ConfigGeneral/SetterFuncs.h +65 -0
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +174 -0
- data/src/apache2_module/{MergeDirConfig.cpp.cxxcodebuilder → DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder} +54 -32
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +113 -0
- data/src/apache2_module/{SetHeaders.cpp.cxxcodebuilder → DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder} +34 -23
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +426 -0
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +165 -0
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +269 -0
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +148 -0
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +534 -0
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +230 -0
- data/src/apache2_module/DirectoryMapper.h +19 -16
- data/src/apache2_module/Hooks.cpp +124 -138
- data/src/apache2_module/Hooks.h +9 -14
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +263 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +152 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +299 -0
- data/src/apache2_module/{ConfigurationFields.hpp.cxxcodebuilder → ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder} +105 -18
- data/src/apache2_module/Utils.h +215 -0
- data/src/apache2_module/mod_passenger.c +16 -8
- data/src/cxx_supportlib/AppTypes.h +2 -0
- data/src/cxx_supportlib/ConfigKit/ConfigKit.h +1 -1
- data/src/cxx_supportlib/ConfigKit/DummyTranslator.h +8 -8
- data/src/cxx_supportlib/ConfigKit/IN_PRACTICE.md +7 -41
- data/src/cxx_supportlib/ConfigKit/PrefixTranslator.h +12 -66
- data/src/cxx_supportlib/ConfigKit/Schema.h +62 -11
- data/src/cxx_supportlib/ConfigKit/{ValidationUtils.h → SchemaUtils.h} +12 -3
- data/src/cxx_supportlib/ConfigKit/Store.h +17 -9
- data/src/cxx_supportlib/ConfigKit/SubComponentUtils.h +2 -1
- data/src/cxx_supportlib/ConfigKit/TableTranslator.h +13 -70
- data/src/cxx_supportlib/ConfigKit/Translator.h +125 -0
- data/src/cxx_supportlib/Constants.h +1 -3
- data/src/cxx_supportlib/FileTools/FileManip.cpp +297 -0
- data/src/cxx_supportlib/FileTools/FileManip.h +162 -0
- data/src/cxx_supportlib/{Utils → FileTools}/LargeFiles.cpp +6 -3
- data/src/cxx_supportlib/{Utils → FileTools}/LargeFiles.h +7 -5
- data/src/cxx_supportlib/FileTools/PathManip.cpp +240 -0
- data/src/cxx_supportlib/FileTools/PathManip.h +91 -0
- data/src/cxx_supportlib/FileTools/PathManipCBindings.cpp +62 -0
- data/src/{apache2_module/Configuration.h → cxx_supportlib/FileTools/PathManipCBindings.h} +12 -19
- data/src/cxx_supportlib/Hooks.h +19 -16
- data/src/cxx_supportlib/InstanceDirectory.h +11 -0
- data/src/cxx_supportlib/JsonTools/Autocast.h +79 -0
- data/src/cxx_supportlib/JsonTools/CBindings.cpp +364 -0
- data/src/cxx_supportlib/JsonTools/CBindings.h +101 -0
- data/src/cxx_supportlib/LoggingKit/Config.h +13 -0
- data/src/cxx_supportlib/LoggingKit/Context.h +5 -2
- data/src/cxx_supportlib/LoggingKit/Forward.h +0 -1
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +12 -4
- data/src/cxx_supportlib/ResourceLocator.h +15 -0
- data/src/cxx_supportlib/ServerKit/Config.h +156 -0
- data/src/cxx_supportlib/ServerKit/Context.h +59 -38
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +3 -2
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -2
- data/src/cxx_supportlib/ServerKit/Server.h +32 -15
- data/src/cxx_supportlib/Utils.cpp +0 -441
- data/src/cxx_supportlib/Utils.h +0 -158
- data/src/cxx_supportlib/Utils/Curl.h +1 -0
- data/src/cxx_supportlib/Utils/ProcessMetricsCollector.h +1 -0
- data/src/cxx_supportlib/Utils/StrIntUtilsNoStrictAliasing.cpp +2 -0
- data/src/cxx_supportlib/Utils/VariantMap.h +31 -0
- data/src/cxx_supportlib/WatchdogLauncher.cpp +7 -79
- data/src/cxx_supportlib/WatchdogLauncher.h +50 -53
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +981 -0
- data/src/cxx_supportlib/oxt/macros.hpp +9 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/COPYING +145 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/changelog.md +342 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/readme.md +49 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/base64/base64.hpp +178 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/client.hpp +33 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/close.hpp +342 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/asio.hpp +131 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/asio_ssl.hpp +39 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/chrono.hpp +68 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/connection_hdl.hpp +52 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/cpp11.hpp +162 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/functional.hpp +105 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/md5.hpp +448 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/memory.hpp +89 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/network.hpp +106 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/platforms.hpp +46 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/random.hpp +82 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/regex.hpp +59 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/stdint.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/system_error.hpp +84 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/thread.hpp +84 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/time.hpp +56 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/common/type_traits.hpp +65 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/concurrency/basic.hpp +46 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/concurrency/none.hpp +80 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio_client.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio_no_tls.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/asio_no_tls_client.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/boost_config.hpp +72 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/core.hpp +285 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/core_client.hpp +294 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/debug.hpp +286 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/debug_asio.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/debug_asio_no_tls.hpp +73 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/minimal_client.hpp +72 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/config/minimal_server.hpp +312 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/connection.hpp +1651 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/connection_base.hpp +38 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/endpoint.hpp +700 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/endpoint_base.hpp +38 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/error.hpp +277 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/extensions/extension.hpp +102 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/extensions/permessage_deflate/disabled.hpp +128 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/extensions/permessage_deflate/enabled.hpp +752 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/frame.hpp +861 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/constants.hpp +308 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/impl/parser.hpp +196 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/impl/request.hpp +191 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/impl/response.hpp +266 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/parser.hpp +619 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/request.hpp +124 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/http/response.hpp +188 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/impl/connection_impl.hpp +2372 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/impl/endpoint_impl.hpp +269 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/impl/utilities_impl.hpp +87 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/basic.hpp +199 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/levels.hpp +203 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/stub.hpp +119 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/logger/syslog.hpp +146 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/message_buffer/alloc.hpp +105 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/message_buffer/message.hpp +340 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/message_buffer/pool.hpp +229 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/base.hpp +299 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi00.hpp +462 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi07.hpp +78 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi08.hpp +83 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/hybi13.hpp +1056 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/processors/processor.hpp +407 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/random/none.hpp +60 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/random/random_device.hpp +80 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/roles/client_endpoint.hpp +173 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/roles/server_endpoint.hpp +190 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/server.hpp +33 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/sha1/sha1.hpp +189 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/base.hpp +232 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/connection.hpp +1204 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/endpoint.hpp +1147 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/security/base.hpp +159 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/security/none.hpp +370 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/asio/security/tls.hpp +484 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/base/connection.hpp +238 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/base/endpoint.hpp +77 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/debug/base.hpp +104 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/debug/connection.hpp +412 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/debug/endpoint.hpp +140 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/iostream/base.hpp +133 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/iostream/connection.hpp +714 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/iostream/endpoint.hpp +222 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/stub/base.hpp +95 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/stub/connection.hpp +286 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/transport/stub/endpoint.hpp +140 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/uri.hpp +355 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/utf8_validator.hpp +154 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/utilities.hpp +182 -0
- data/src/cxx_supportlib/vendor-copy/websocketpp/websocketpp/version.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/async_result.hpp +96 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +951 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +520 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_io_object.hpp +258 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +942 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +567 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +697 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +386 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +1519 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +1137 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_iostream.hpp +288 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_streambuf.hpp +569 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +854 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_streambuf.hpp +371 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_streambuf_fwd.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +521 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffer.hpp +2241 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_read_stream.hpp +246 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_read_stream_fwd.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_stream.hpp +260 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_stream_fwd.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_write_stream.hpp +238 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffered_write_stream_fwd.hpp +27 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/buffers_iterator.hpp +483 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/completion_condition.hpp +220 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/connect.hpp +825 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/coroutine.hpp +330 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/datagram_socket_service.hpp +438 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/deadline_timer.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/deadline_timer_service.hpp +173 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/addressof.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/array.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/array_fwd.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/assert.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/atomic_count.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/base_from_completion_cond.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +491 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffer_resize_guard.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffer_sequence_adapter.hpp +385 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/buffered_stream_storage.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/call_stack.hpp +127 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/chrono_time_traits.hpp +192 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/completion_handler.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +1050 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/consuming_buffers.hpp +294 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/cstdint.hpp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/date_time_fwd.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/deadline_timer_service.hpp +229 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/dependent_type.hpp +38 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_ops.hpp +119 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_read_op.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/descriptor_write_op.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/dev_poll_reactor.hpp +208 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/epoll_reactor.hpp +244 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/event.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/eventfd_select_interrupter.hpp +85 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/fd_set_adapter.hpp +41 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/fenced_block.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/function.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_arm_fenced_block.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_hppa_fenced_block.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_sync_fenced_block.hpp +65 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/gcc_x86_fenced_block.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_cont_helpers.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_invoke_helpers.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_tracking.hpp +161 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_type_requirements.hpp +480 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/hash_map.hpp +333 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/buffer_sequence_adapter.ipp +120 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +453 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.hpp +80 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/dev_poll_reactor.ipp +432 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/epoll_reactor.hpp +78 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/epoll_reactor.ipp +688 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/eventfd_select_interrupter.ipp +167 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +307 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/kqueue_reactor.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/kqueue_reactor.ipp +498 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/pipe_select_interrupter.ipp +126 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_event.ipp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_mutex.ipp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_thread.ipp +76 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/posix_tss_ptr.ipp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_descriptor_service.ipp +210 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_serial_port_service.ipp +153 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/reactive_socket_service_base.ipp +269 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/resolver_service_base.ipp +132 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.hpp +89 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +315 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/service_registry.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/service_registry.ipp +190 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/signal_set_service.ipp +649 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +3470 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_select_interrupter.ipp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_service.hpp +120 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_service.ipp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/task_io_service.hpp +80 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/task_io_service.ipp +476 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/throw_error.ipp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/timer_queue_ptime.ipp +86 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/timer_queue_set.ipp +103 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/io_control.hpp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/keyword_tss_ptr.hpp +72 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/kqueue_reactor.hpp +222 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/limits.hpp +26 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/local_free_on_block_exit.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/macos_fenced_block.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +31 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/mutex.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/noncopyable.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_event.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_fenced_block.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_mutex.hpp +66 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_reactor.hpp +69 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_signal_blocker.hpp +71 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_socket_service.hpp +500 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_static_mutex.hpp +62 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_thread.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/null_tss_ptr.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/object_pool.hpp +148 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/old_win_sdk_compat.hpp +216 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/op_queue.hpp +158 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/operation.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/pipe_select_interrupter.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/pop_options.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_event.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_fd_set_adapter.hpp +120 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_mutex.hpp +78 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_signal_blocker.hpp +87 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_static_mutex.hpp +66 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_thread.hpp +107 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/posix_tss_ptr.hpp +81 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/push_options.hpp +166 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_descriptor_service.hpp +324 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_null_buffers_op.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_serial_port_service.hpp +236 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_accept_op.hpp +138 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_connect_op.hpp +108 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recv_op.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recvfrom_op.hpp +135 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_recvmsg_op.hpp +127 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_send_op.hpp +122 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_sendto_op.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service.hpp +460 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactive_socket_service_base.hpp +452 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_fwd.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_op.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/reactor_op_queue.hpp +170 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/regex_fwd.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_endpoint_op.hpp +123 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolve_op.hpp +133 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolver_service.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/resolver_service_base.hpp +131 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/scoped_lock.hpp +103 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/scoped_ptr.hpp +81 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/select_interrupter.hpp +48 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/select_reactor.hpp +221 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/service_registry.hpp +146 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/shared_ptr.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_blocker.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_handler.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_init.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_op.hpp +51 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/signal_set_service.hpp +218 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_holder.hpp +100 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_ops.hpp +336 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_option.hpp +318 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_select_interrupter.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/socket_types.hpp +410 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/solaris_fenced_block.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/static_mutex.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_event.hpp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_fenced_block.hpp +64 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_mutex.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_static_mutex.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/std_thread.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/strand_service.hpp +144 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/task_io_service.hpp +203 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/task_io_service_operation.hpp +78 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/task_io_service_thread_info.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread.hpp +58 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/thread_info_base.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/throw_error.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/throw_exception.hpp +53 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue.hpp +333 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_base.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_ptime.hpp +95 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_queue_set.hpp +68 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_scheduler.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/timer_scheduler_fwd.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/tss_ptr.hpp +71 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/type_traits.hpp +60 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/variadic_templates.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wait_handler.hpp +85 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wait_op.hpp +47 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/weak_ptr.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/win_iocp_serial_port_service.hpp +230 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/winsock_init.hpp +130 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/detail/wrapped_handler.hpp +293 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/error.hpp +345 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/basic_endpoint.hpp +195 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/datagram_protocol.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/detail/endpoint.hpp +135 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/detail/impl/endpoint.ipp +111 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/raw_protocol.hpp +123 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/seq_packet_protocol.hpp +124 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/generic/stream_protocol.hpp +129 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_alloc_hook.hpp +83 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_continuation_hook.hpp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_invoke_hook.hpp +87 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/handler_type.hpp +114 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/high_resolution_timer.hpp +65 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +360 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +340 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +432 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/error.ipp +130 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +79 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_service.hpp +156 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/io_service.ipp +157 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +755 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +812 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +1149 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/serial_port_base.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/serial_port_base.ipp +556 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +355 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.cpp +25 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +179 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +767 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +827 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/io_service.hpp +772 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address.hpp +202 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v4.hpp +243 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/address_v6.hpp +248 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_endpoint.hpp +265 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver.hpp +270 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_entry.hpp +96 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_iterator.hpp +262 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/basic_resolver_query.hpp +246 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/endpoint.hpp +141 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/impl/endpoint.ipp +206 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/detail/socket_option.hpp +571 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/host_name.hpp +44 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/icmp.hpp +117 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address.ipp +228 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v4.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v4.ipp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.hpp +55 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/address_v6.ipp +300 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/basic_endpoint.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/host_name.ipp +56 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/multicast.hpp +193 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/resolver_query_base.hpp +132 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/resolver_service.hpp +178 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/tcp.hpp +157 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/udp.hpp +113 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/unicast.hpp +72 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ip/v6_only.hpp +71 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/is_read_buffered.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/is_write_buffered.hpp +61 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/basic_endpoint.hpp +241 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/connect_pair.hpp +106 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/datagram_protocol.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/detail/endpoint.hpp +135 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/detail/impl/endpoint.ipp +130 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/local/stream_protocol.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/placeholders.hpp +125 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +492 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +364 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/descriptor_base.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/stream_descriptor.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/posix/stream_descriptor_service.hpp +262 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/raw_socket_service.hpp +438 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/read.hpp +633 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_at.hpp +666 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/read_until.hpp +925 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/seq_packet_socket_service.hpp +386 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port.hpp +38 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port_base.hpp +169 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/serial_port_service.hpp +255 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/signal_set.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/signal_set_service.hpp +136 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/socket_acceptor_service.hpp +308 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/socket_base.hpp +522 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +267 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/basic_context.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context.hpp +789 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context_base.hpp +194 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/context_service.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/buffered_handshake_op.hpp +112 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/engine.hpp +166 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/handshake_op.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/engine.ipp +327 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/impl/openssl_init.ipp +166 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +351 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/openssl_init.hpp +103 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/openssl_types.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/password_callback.hpp +74 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/read_op.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/shutdown_op.hpp +62 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/stream_core.hpp +128 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/verify_callback.hpp +70 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/write_op.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/error.hpp +115 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/context.ipp +1177 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/error.ipp +102 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/rfc2818_verification.ipp +168 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/impl/src.hpp +28 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/basic_context.hpp +436 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/context_service.hpp +176 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_context_service.hpp +396 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_operation.hpp +526 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/detail/openssl_stream_service.hpp +573 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/stream.hpp +503 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/old/stream_service.hpp +186 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/rfc2818_verification.hpp +102 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream.hpp +758 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream_base.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/stream_service.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/verify_context.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/verify_mode.hpp +65 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/steady_timer.hpp +63 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +254 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/stream_socket_service.hpp +382 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/streambuf.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/system_timer.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/time_traits.hpp +88 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/unyield.hpp +21 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/use_future.hpp +94 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/wait_traits.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/waitable_timer_service.hpp +170 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_handle.hpp +283 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +378 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +361 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/object_handle.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/object_handle_service.hpp +179 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/overlapped_ptr.hpp +118 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/random_access_handle.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/random_access_handle_service.hpp +222 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/stream_handle.hpp +39 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/windows/stream_handle_service.hpp +220 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/write.hpp +620 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/write_at.hpp +672 -0
- data/src/cxx_supportlib/vendor-modified/boost/asio/yield.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono.hpp +20 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/chrono.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/chrono_io.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/chrono.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +242 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp +356 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/thread_clock.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/chrono.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp +354 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/posix/thread_clock.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/process_cpu_clocks.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/thread_clock.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp +54 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/scan_keyword.hpp +163 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/floor.hpp +36 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/include.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_get.hpp +593 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +295 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_put.hpp +317 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_style.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_units.hpp +1003 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/ios_base_state.hpp +152 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_get.hpp +330 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +1243 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_put.hpp +261 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_units.hpp +260 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/timezone.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/ios_base_state_ptr.hpp +437 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/manip_base.hpp +101 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/to_string.hpp +50 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/io_v1/chrono_io.hpp +637 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/process_cpu_clocks.hpp +525 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/round.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/thread_clock.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/typeof/boost/chrono/chrono.hpp +32 -0
- data/src/cxx_supportlib/vendor-modified/boost/chrono/typeof/boost/ratio.hpp +24 -0
- data/src/cxx_supportlib/vendor-modified/boost/detail/atomic_count.hpp +21 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/common_factor.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/common_factor_rt.hpp +460 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/integer_log2.hpp +112 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/integer_mask.hpp +126 -0
- data/src/cxx_supportlib/vendor-modified/boost/integer/static_min_max.hpp +51 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/chrono/src/chrono.cpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/chrono/src/process_cpu_clocks.cpp +18 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/chrono/src/thread_clock.cpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/libs/random/src/random_device.cpp +250 -0
- data/src/cxx_supportlib/vendor-modified/boost/pointer_cast.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/random.hpp +91 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/additive_combine.hpp +283 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/bernoulli_distribution.hpp +197 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/beta_distribution.hpp +184 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/binomial_distribution.hpp +434 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/cauchy_distribution.hpp +214 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/chi_squared_distribution.hpp +209 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/auto_link.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/config.hpp +18 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/const_mod.hpp +216 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/disable_warnings.hpp +29 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/enable_warnings.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/generator_bits.hpp +36 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/generator_seed_seq.hpp +40 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/int_float_pair.hpp +121 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/integer_log2.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/iterator_mixin.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/large_arithmetic.hpp +122 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/operators.hpp +84 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/polynomial.hpp +384 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/ptr_helper.hpp +67 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/seed.hpp +115 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/seed_impl.hpp +398 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/signed_unsigned_tools.hpp +89 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/uniform_int_float.hpp +76 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/detail/vector_io.hpp +75 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/discard_block.hpp +241 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/discrete_distribution.hpp +636 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/exponential_distribution.hpp +386 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/extreme_value_distribution.hpp +177 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/fisher_f_distribution.hpp +183 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/gamma_distribution.hpp +292 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/generate_canonical.hpp +96 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/geometric_distribution.hpp +267 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/hyperexponential_distribution.hpp +883 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/independent_bits.hpp +271 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/inversive_congruential.hpp +267 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/lagged_fibonacci.hpp +537 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/laplace_distribution.hpp +175 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/linear_congruential.hpp +466 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/linear_feedback_shift.hpp +217 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/lognormal_distribution.hpp +254 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/mersenne_twister.hpp +682 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/negative_binomial_distribution.hpp +220 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/non_central_chi_squared_distribution.hpp +221 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/normal_distribution.hpp +374 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/piecewise_constant_distribution.hpp +466 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/piecewise_linear_distribution.hpp +531 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/poisson_distribution.hpp +360 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/random_device.hpp +143 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/random_number_generator.hpp +73 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/ranlux.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/seed_seq.hpp +118 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/shuffle_order.hpp +269 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/shuffle_output.hpp +51 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/student_t_distribution.hpp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/subtract_with_carry.hpp +613 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/taus88.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/traits.hpp +107 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/triangle_distribution.hpp +232 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_01.hpp +257 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_int.hpp +99 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_int_distribution.hpp +419 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_on_sphere.hpp +284 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_real.hpp +82 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_real_distribution.hpp +241 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_smallint.hpp +307 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/variate_generator.hpp +122 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/weibull_distribution.hpp +177 -0
- data/src/cxx_supportlib/vendor-modified/boost/random/xor_combine.hpp +208 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio.hpp +14 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/detail/ratio_io.hpp +1342 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/include.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/abs.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/arithmetic.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/comparison.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/divides.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/equal_to.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/gcd.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/greater.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/greater_equal.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/lcm.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/less.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/less_equal.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/minus.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/negate.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/not_equal_to.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/numeric_cast.hpp +31 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/plus.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/rational_c_tag.hpp +25 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/rational_constant.hpp +15 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/sign.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/mpl/times.hpp +30 -0
- data/src/cxx_supportlib/vendor-modified/boost/ratio/ratio_io.hpp +1076 -0
- data/src/cxx_supportlib/vendor-modified/boost/rational.hpp +1002 -0
- data/src/cxx_supportlib/vendor-modified/modp_b64.cpp +11 -0
- data/src/helper-scripts/rack-preloader.rb +1 -1
- data/src/nginx_module/{ConfigurationCommands.c → ConfigGeneral/AutoGeneratedDefinitions.c} +351 -134
- data/src/nginx_module/{ConfigurationCommands.c.cxxcodebuilder → ConfigGeneral/AutoGeneratedDefinitions.c.cxxcodebuilder} +14 -25
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +396 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c.cxxcodebuilder +160 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +831 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c.cxxcodebuilder +168 -0
- data/src/nginx_module/ConfigGeneral/ManifestGeneration.c +887 -0
- data/src/nginx_module/ConfigGeneral/ManifestGeneration.h +100 -0
- data/src/nginx_module/Configuration.c +165 -621
- data/src/nginx_module/Configuration.h +43 -33
- data/src/nginx_module/ContentHandler.c +46 -40
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +282 -0
- data/src/nginx_module/{CreateLocationConfig.c.cxxcodebuilder → LocationConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder} +43 -17
- data/src/nginx_module/{CacheLocationConfig.c → LocationConfig/AutoGeneratedHeaderSerialization.c} +148 -180
- data/src/nginx_module/{CacheLocationConfig.c.cxxcodebuilder → LocationConfig/AutoGeneratedHeaderSerialization.c.cxxcodebuilder} +13 -11
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +595 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +190 -0
- data/src/nginx_module/{MergeLocationConfig.c → LocationConfig/AutoGeneratedMergeFunction.c} +32 -42
- data/src/nginx_module/{MergeLocationConfig.c.cxxcodebuilder → LocationConfig/AutoGeneratedMergeFunction.c.cxxcodebuilder} +18 -11
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +220 -0
- data/src/nginx_module/{LocationConfig.h.cxxcodebuilder → LocationConfig/AutoGeneratedStruct.h.cxxcodebuilder} +70 -48
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +163 -0
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +125 -0
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +303 -0
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +173 -0
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +133 -0
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h.cxxcodebuilder +154 -0
- data/src/nginx_module/config +13 -4
- data/src/nginx_module/ngx_http_passenger_module.c +154 -84
- data/src/ruby_supportlib/phusion_passenger.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +613 -131
- data/src/ruby_supportlib/phusion_passenger/apache2/config_utils.rb +52 -0
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +18 -4
- data/src/ruby_supportlib/phusion_passenger/config/main.rb +2 -0
- data/src/ruby_supportlib/phusion_passenger/config/system_properties_command.rb +104 -0
- data/src/ruby_supportlib/phusion_passenger/constants.rb +0 -2
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +470 -138
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info.rb +17 -0
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +11 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +7 -7
- data/src/ruby_supportlib/phusion_passenger/platform_info/networking.rb +293 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +8 -54
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -5
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -7
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +1 -1
- data/src/schema_printer/SchemaPrinterMain.cpp +78 -0
- data/src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder +116 -0
- metadata +671 -30
- data/src/apache2_module/Configuration.cpp +0 -737
- data/src/apache2_module/Configuration.hpp +0 -274
- data/src/apache2_module/ConfigurationCommands.cpp +0 -199
- data/src/apache2_module/ConfigurationFields.hpp +0 -187
- data/src/apache2_module/ConfigurationSetters.cpp +0 -436
- data/src/apache2_module/ConfigurationSetters.cpp.cxxcodebuilder +0 -144
- data/src/apache2_module/CreateDirConfig.cpp +0 -68
- data/src/apache2_module/CreateDirConfig.cpp.cxxcodebuilder +0 -81
- data/src/apache2_module/MergeDirConfig.cpp +0 -155
- data/src/apache2_module/SetHeaders.cpp +0 -111
- data/src/nginx_module/CreateLocationConfig.c +0 -100
- data/src/nginx_module/LocationConfig.h +0 -95
@@ -0,0 +1,386 @@
|
|
1
|
+
//
|
2
|
+
// basic_signal_set.hpp
|
3
|
+
// ~~~~~~~~~~~~~~~~~~~~
|
4
|
+
//
|
5
|
+
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
6
|
+
//
|
7
|
+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
8
|
+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
9
|
+
//
|
10
|
+
|
11
|
+
#ifndef BOOST_ASIO_BASIC_SIGNAL_SET_HPP
|
12
|
+
#define BOOST_ASIO_BASIC_SIGNAL_SET_HPP
|
13
|
+
|
14
|
+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
15
|
+
# pragma once
|
16
|
+
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
17
|
+
|
18
|
+
#include <boost/asio/detail/config.hpp>
|
19
|
+
|
20
|
+
#include <boost/asio/basic_io_object.hpp>
|
21
|
+
#include <boost/asio/detail/handler_type_requirements.hpp>
|
22
|
+
#include <boost/asio/detail/throw_error.hpp>
|
23
|
+
#include <boost/asio/error.hpp>
|
24
|
+
#include <boost/asio/signal_set_service.hpp>
|
25
|
+
|
26
|
+
#include <boost/asio/detail/push_options.hpp>
|
27
|
+
|
28
|
+
namespace boost {
|
29
|
+
namespace asio {
|
30
|
+
|
31
|
+
/// Provides signal functionality.
|
32
|
+
/**
|
33
|
+
* The basic_signal_set class template provides the ability to perform an
|
34
|
+
* asynchronous wait for one or more signals to occur.
|
35
|
+
*
|
36
|
+
* Most applications will use the boost::asio::signal_set typedef.
|
37
|
+
*
|
38
|
+
* @par Thread Safety
|
39
|
+
* @e Distinct @e objects: Safe.@n
|
40
|
+
* @e Shared @e objects: Unsafe.
|
41
|
+
*
|
42
|
+
* @par Example
|
43
|
+
* Performing an asynchronous wait:
|
44
|
+
* @code
|
45
|
+
* void handler(
|
46
|
+
* const boost::system::error_code& error,
|
47
|
+
* int signal_number)
|
48
|
+
* {
|
49
|
+
* if (!error)
|
50
|
+
* {
|
51
|
+
* // A signal occurred.
|
52
|
+
* }
|
53
|
+
* }
|
54
|
+
*
|
55
|
+
* ...
|
56
|
+
*
|
57
|
+
* // Construct a signal set registered for process termination.
|
58
|
+
* boost::asio::signal_set signals(io_service, SIGINT, SIGTERM);
|
59
|
+
*
|
60
|
+
* // Start an asynchronous wait for one of the signals to occur.
|
61
|
+
* signals.async_wait(handler);
|
62
|
+
* @endcode
|
63
|
+
*
|
64
|
+
* @par Queueing of signal notifications
|
65
|
+
*
|
66
|
+
* If a signal is registered with a signal_set, and the signal occurs when
|
67
|
+
* there are no waiting handlers, then the signal notification is queued. The
|
68
|
+
* next async_wait operation on that signal_set will dequeue the notification.
|
69
|
+
* If multiple notifications are queued, subsequent async_wait operations
|
70
|
+
* dequeue them one at a time. Signal notifications are dequeued in order of
|
71
|
+
* ascending signal number.
|
72
|
+
*
|
73
|
+
* If a signal number is removed from a signal_set (using the @c remove or @c
|
74
|
+
* erase member functions) then any queued notifications for that signal are
|
75
|
+
* discarded.
|
76
|
+
*
|
77
|
+
* @par Multiple registration of signals
|
78
|
+
*
|
79
|
+
* The same signal number may be registered with different signal_set objects.
|
80
|
+
* When the signal occurs, one handler is called for each signal_set object.
|
81
|
+
*
|
82
|
+
* Note that multiple registration only works for signals that are registered
|
83
|
+
* using Asio. The application must not also register a signal handler using
|
84
|
+
* functions such as @c signal() or @c sigaction().
|
85
|
+
*
|
86
|
+
* @par Signal masking on POSIX platforms
|
87
|
+
*
|
88
|
+
* POSIX allows signals to be blocked using functions such as @c sigprocmask()
|
89
|
+
* and @c pthread_sigmask(). For signals to be delivered, programs must ensure
|
90
|
+
* that any signals registered using signal_set objects are unblocked in at
|
91
|
+
* least one thread.
|
92
|
+
*/
|
93
|
+
template <typename SignalSetService = signal_set_service>
|
94
|
+
class basic_signal_set
|
95
|
+
: public basic_io_object<SignalSetService>
|
96
|
+
{
|
97
|
+
public:
|
98
|
+
/// Construct a signal set without adding any signals.
|
99
|
+
/**
|
100
|
+
* This constructor creates a signal set without registering for any signals.
|
101
|
+
*
|
102
|
+
* @param io_service The io_service object that the signal set will use to
|
103
|
+
* dispatch handlers for any asynchronous operations performed on the set.
|
104
|
+
*/
|
105
|
+
explicit basic_signal_set(boost::asio::io_service& io_service)
|
106
|
+
: basic_io_object<SignalSetService>(io_service)
|
107
|
+
{
|
108
|
+
}
|
109
|
+
|
110
|
+
/// Construct a signal set and add one signal.
|
111
|
+
/**
|
112
|
+
* This constructor creates a signal set and registers for one signal.
|
113
|
+
*
|
114
|
+
* @param io_service The io_service object that the signal set will use to
|
115
|
+
* dispatch handlers for any asynchronous operations performed on the set.
|
116
|
+
*
|
117
|
+
* @param signal_number_1 The signal number to be added.
|
118
|
+
*
|
119
|
+
* @note This constructor is equivalent to performing:
|
120
|
+
* @code boost::asio::signal_set signals(io_service);
|
121
|
+
* signals.add(signal_number_1); @endcode
|
122
|
+
*/
|
123
|
+
basic_signal_set(boost::asio::io_service& io_service, int signal_number_1)
|
124
|
+
: basic_io_object<SignalSetService>(io_service)
|
125
|
+
{
|
126
|
+
boost::system::error_code ec;
|
127
|
+
this->service.add(this->implementation, signal_number_1, ec);
|
128
|
+
boost::asio::detail::throw_error(ec, "add");
|
129
|
+
}
|
130
|
+
|
131
|
+
/// Construct a signal set and add two signals.
|
132
|
+
/**
|
133
|
+
* This constructor creates a signal set and registers for two signals.
|
134
|
+
*
|
135
|
+
* @param io_service The io_service object that the signal set will use to
|
136
|
+
* dispatch handlers for any asynchronous operations performed on the set.
|
137
|
+
*
|
138
|
+
* @param signal_number_1 The first signal number to be added.
|
139
|
+
*
|
140
|
+
* @param signal_number_2 The second signal number to be added.
|
141
|
+
*
|
142
|
+
* @note This constructor is equivalent to performing:
|
143
|
+
* @code boost::asio::signal_set signals(io_service);
|
144
|
+
* signals.add(signal_number_1);
|
145
|
+
* signals.add(signal_number_2); @endcode
|
146
|
+
*/
|
147
|
+
basic_signal_set(boost::asio::io_service& io_service, int signal_number_1,
|
148
|
+
int signal_number_2)
|
149
|
+
: basic_io_object<SignalSetService>(io_service)
|
150
|
+
{
|
151
|
+
boost::system::error_code ec;
|
152
|
+
this->service.add(this->implementation, signal_number_1, ec);
|
153
|
+
boost::asio::detail::throw_error(ec, "add");
|
154
|
+
this->service.add(this->implementation, signal_number_2, ec);
|
155
|
+
boost::asio::detail::throw_error(ec, "add");
|
156
|
+
}
|
157
|
+
|
158
|
+
/// Construct a signal set and add three signals.
|
159
|
+
/**
|
160
|
+
* This constructor creates a signal set and registers for three signals.
|
161
|
+
*
|
162
|
+
* @param io_service The io_service object that the signal set will use to
|
163
|
+
* dispatch handlers for any asynchronous operations performed on the set.
|
164
|
+
*
|
165
|
+
* @param signal_number_1 The first signal number to be added.
|
166
|
+
*
|
167
|
+
* @param signal_number_2 The second signal number to be added.
|
168
|
+
*
|
169
|
+
* @param signal_number_3 The third signal number to be added.
|
170
|
+
*
|
171
|
+
* @note This constructor is equivalent to performing:
|
172
|
+
* @code boost::asio::signal_set signals(io_service);
|
173
|
+
* signals.add(signal_number_1);
|
174
|
+
* signals.add(signal_number_2);
|
175
|
+
* signals.add(signal_number_3); @endcode
|
176
|
+
*/
|
177
|
+
basic_signal_set(boost::asio::io_service& io_service, int signal_number_1,
|
178
|
+
int signal_number_2, int signal_number_3)
|
179
|
+
: basic_io_object<SignalSetService>(io_service)
|
180
|
+
{
|
181
|
+
boost::system::error_code ec;
|
182
|
+
this->service.add(this->implementation, signal_number_1, ec);
|
183
|
+
boost::asio::detail::throw_error(ec, "add");
|
184
|
+
this->service.add(this->implementation, signal_number_2, ec);
|
185
|
+
boost::asio::detail::throw_error(ec, "add");
|
186
|
+
this->service.add(this->implementation, signal_number_3, ec);
|
187
|
+
boost::asio::detail::throw_error(ec, "add");
|
188
|
+
}
|
189
|
+
|
190
|
+
/// Add a signal to a signal_set.
|
191
|
+
/**
|
192
|
+
* This function adds the specified signal to the set. It has no effect if the
|
193
|
+
* signal is already in the set.
|
194
|
+
*
|
195
|
+
* @param signal_number The signal to be added to the set.
|
196
|
+
*
|
197
|
+
* @throws boost::system::system_error Thrown on failure.
|
198
|
+
*/
|
199
|
+
void add(int signal_number)
|
200
|
+
{
|
201
|
+
boost::system::error_code ec;
|
202
|
+
this->service.add(this->implementation, signal_number, ec);
|
203
|
+
boost::asio::detail::throw_error(ec, "add");
|
204
|
+
}
|
205
|
+
|
206
|
+
/// Add a signal to a signal_set.
|
207
|
+
/**
|
208
|
+
* This function adds the specified signal to the set. It has no effect if the
|
209
|
+
* signal is already in the set.
|
210
|
+
*
|
211
|
+
* @param signal_number The signal to be added to the set.
|
212
|
+
*
|
213
|
+
* @param ec Set to indicate what error occurred, if any.
|
214
|
+
*/
|
215
|
+
boost::system::error_code add(int signal_number,
|
216
|
+
boost::system::error_code& ec)
|
217
|
+
{
|
218
|
+
return this->service.add(this->implementation, signal_number, ec);
|
219
|
+
}
|
220
|
+
|
221
|
+
/// Remove a signal from a signal_set.
|
222
|
+
/**
|
223
|
+
* This function removes the specified signal from the set. It has no effect
|
224
|
+
* if the signal is not in the set.
|
225
|
+
*
|
226
|
+
* @param signal_number The signal to be removed from the set.
|
227
|
+
*
|
228
|
+
* @throws boost::system::system_error Thrown on failure.
|
229
|
+
*
|
230
|
+
* @note Removes any notifications that have been queued for the specified
|
231
|
+
* signal number.
|
232
|
+
*/
|
233
|
+
void remove(int signal_number)
|
234
|
+
{
|
235
|
+
boost::system::error_code ec;
|
236
|
+
this->service.remove(this->implementation, signal_number, ec);
|
237
|
+
boost::asio::detail::throw_error(ec, "remove");
|
238
|
+
}
|
239
|
+
|
240
|
+
/// Remove a signal from a signal_set.
|
241
|
+
/**
|
242
|
+
* This function removes the specified signal from the set. It has no effect
|
243
|
+
* if the signal is not in the set.
|
244
|
+
*
|
245
|
+
* @param signal_number The signal to be removed from the set.
|
246
|
+
*
|
247
|
+
* @param ec Set to indicate what error occurred, if any.
|
248
|
+
*
|
249
|
+
* @note Removes any notifications that have been queued for the specified
|
250
|
+
* signal number.
|
251
|
+
*/
|
252
|
+
boost::system::error_code remove(int signal_number,
|
253
|
+
boost::system::error_code& ec)
|
254
|
+
{
|
255
|
+
return this->service.remove(this->implementation, signal_number, ec);
|
256
|
+
}
|
257
|
+
|
258
|
+
/// Remove all signals from a signal_set.
|
259
|
+
/**
|
260
|
+
* This function removes all signals from the set. It has no effect if the set
|
261
|
+
* is already empty.
|
262
|
+
*
|
263
|
+
* @throws boost::system::system_error Thrown on failure.
|
264
|
+
*
|
265
|
+
* @note Removes all queued notifications.
|
266
|
+
*/
|
267
|
+
void clear()
|
268
|
+
{
|
269
|
+
boost::system::error_code ec;
|
270
|
+
this->service.clear(this->implementation, ec);
|
271
|
+
boost::asio::detail::throw_error(ec, "clear");
|
272
|
+
}
|
273
|
+
|
274
|
+
/// Remove all signals from a signal_set.
|
275
|
+
/**
|
276
|
+
* This function removes all signals from the set. It has no effect if the set
|
277
|
+
* is already empty.
|
278
|
+
*
|
279
|
+
* @param ec Set to indicate what error occurred, if any.
|
280
|
+
*
|
281
|
+
* @note Removes all queued notifications.
|
282
|
+
*/
|
283
|
+
boost::system::error_code clear(boost::system::error_code& ec)
|
284
|
+
{
|
285
|
+
return this->service.clear(this->implementation, ec);
|
286
|
+
}
|
287
|
+
|
288
|
+
/// Cancel all operations associated with the signal set.
|
289
|
+
/**
|
290
|
+
* This function forces the completion of any pending asynchronous wait
|
291
|
+
* operations against the signal set. The handler for each cancelled
|
292
|
+
* operation will be invoked with the boost::asio::error::operation_aborted
|
293
|
+
* error code.
|
294
|
+
*
|
295
|
+
* Cancellation does not alter the set of registered signals.
|
296
|
+
*
|
297
|
+
* @throws boost::system::system_error Thrown on failure.
|
298
|
+
*
|
299
|
+
* @note If a registered signal occurred before cancel() is called, then the
|
300
|
+
* handlers for asynchronous wait operations will:
|
301
|
+
*
|
302
|
+
* @li have already been invoked; or
|
303
|
+
*
|
304
|
+
* @li have been queued for invocation in the near future.
|
305
|
+
*
|
306
|
+
* These handlers can no longer be cancelled, and therefore are passed an
|
307
|
+
* error code that indicates the successful completion of the wait operation.
|
308
|
+
*/
|
309
|
+
void cancel()
|
310
|
+
{
|
311
|
+
boost::system::error_code ec;
|
312
|
+
this->service.cancel(this->implementation, ec);
|
313
|
+
boost::asio::detail::throw_error(ec, "cancel");
|
314
|
+
}
|
315
|
+
|
316
|
+
/// Cancel all operations associated with the signal set.
|
317
|
+
/**
|
318
|
+
* This function forces the completion of any pending asynchronous wait
|
319
|
+
* operations against the signal set. The handler for each cancelled
|
320
|
+
* operation will be invoked with the boost::asio::error::operation_aborted
|
321
|
+
* error code.
|
322
|
+
*
|
323
|
+
* Cancellation does not alter the set of registered signals.
|
324
|
+
*
|
325
|
+
* @param ec Set to indicate what error occurred, if any.
|
326
|
+
*
|
327
|
+
* @note If a registered signal occurred before cancel() is called, then the
|
328
|
+
* handlers for asynchronous wait operations will:
|
329
|
+
*
|
330
|
+
* @li have already been invoked; or
|
331
|
+
*
|
332
|
+
* @li have been queued for invocation in the near future.
|
333
|
+
*
|
334
|
+
* These handlers can no longer be cancelled, and therefore are passed an
|
335
|
+
* error code that indicates the successful completion of the wait operation.
|
336
|
+
*/
|
337
|
+
boost::system::error_code cancel(boost::system::error_code& ec)
|
338
|
+
{
|
339
|
+
return this->service.cancel(this->implementation, ec);
|
340
|
+
}
|
341
|
+
|
342
|
+
/// Start an asynchronous operation to wait for a signal to be delivered.
|
343
|
+
/**
|
344
|
+
* This function may be used to initiate an asynchronous wait against the
|
345
|
+
* signal set. It always returns immediately.
|
346
|
+
*
|
347
|
+
* For each call to async_wait(), the supplied handler will be called exactly
|
348
|
+
* once. The handler will be called when:
|
349
|
+
*
|
350
|
+
* @li One of the registered signals in the signal set occurs; or
|
351
|
+
*
|
352
|
+
* @li The signal set was cancelled, in which case the handler is passed the
|
353
|
+
* error code boost::asio::error::operation_aborted.
|
354
|
+
*
|
355
|
+
* @param handler The handler to be called when the signal occurs. Copies
|
356
|
+
* will be made of the handler as required. The function signature of the
|
357
|
+
* handler must be:
|
358
|
+
* @code void handler(
|
359
|
+
* const boost::system::error_code& error, // Result of operation.
|
360
|
+
* int signal_number // Indicates which signal occurred.
|
361
|
+
* ); @endcode
|
362
|
+
* Regardless of whether the asynchronous operation completes immediately or
|
363
|
+
* not, the handler will not be invoked from within this function. Invocation
|
364
|
+
* of the handler will be performed in a manner equivalent to using
|
365
|
+
* boost::asio::io_service::post().
|
366
|
+
*/
|
367
|
+
template <typename SignalHandler>
|
368
|
+
BOOST_ASIO_INITFN_RESULT_TYPE(SignalHandler,
|
369
|
+
void (boost::system::error_code, int))
|
370
|
+
async_wait(BOOST_ASIO_MOVE_ARG(SignalHandler) handler)
|
371
|
+
{
|
372
|
+
// If you get an error on the following line it means that your handler does
|
373
|
+
// not meet the documented type requirements for a SignalHandler.
|
374
|
+
BOOST_ASIO_SIGNAL_HANDLER_CHECK(SignalHandler, handler) type_check;
|
375
|
+
|
376
|
+
return this->service.async_wait(this->implementation,
|
377
|
+
BOOST_ASIO_MOVE_CAST(SignalHandler)(handler));
|
378
|
+
}
|
379
|
+
};
|
380
|
+
|
381
|
+
} // namespace asio
|
382
|
+
} // namespace boost
|
383
|
+
|
384
|
+
#include <boost/asio/detail/pop_options.hpp>
|
385
|
+
|
386
|
+
#endif // BOOST_ASIO_BASIC_SIGNAL_SET_HPP
|
@@ -0,0 +1,1519 @@
|
|
1
|
+
//
|
2
|
+
// basic_socket.hpp
|
3
|
+
// ~~~~~~~~~~~~~~~~
|
4
|
+
//
|
5
|
+
// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
6
|
+
//
|
7
|
+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
8
|
+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
9
|
+
//
|
10
|
+
|
11
|
+
#ifndef BOOST_ASIO_BASIC_SOCKET_HPP
|
12
|
+
#define BOOST_ASIO_BASIC_SOCKET_HPP
|
13
|
+
|
14
|
+
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
15
|
+
# pragma once
|
16
|
+
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
17
|
+
|
18
|
+
#include <boost/asio/detail/config.hpp>
|
19
|
+
#include <boost/asio/async_result.hpp>
|
20
|
+
#include <boost/asio/basic_io_object.hpp>
|
21
|
+
#include <boost/asio/detail/handler_type_requirements.hpp>
|
22
|
+
#include <boost/asio/detail/throw_error.hpp>
|
23
|
+
#include <boost/asio/detail/type_traits.hpp>
|
24
|
+
#include <boost/asio/error.hpp>
|
25
|
+
#include <boost/asio/socket_base.hpp>
|
26
|
+
|
27
|
+
#include <boost/asio/detail/push_options.hpp>
|
28
|
+
|
29
|
+
namespace boost {
|
30
|
+
namespace asio {
|
31
|
+
|
32
|
+
/// Provides socket functionality.
|
33
|
+
/**
|
34
|
+
* The basic_socket class template provides functionality that is common to both
|
35
|
+
* stream-oriented and datagram-oriented sockets.
|
36
|
+
*
|
37
|
+
* @par Thread Safety
|
38
|
+
* @e Distinct @e objects: Safe.@n
|
39
|
+
* @e Shared @e objects: Unsafe.
|
40
|
+
*/
|
41
|
+
template <typename Protocol, typename SocketService>
|
42
|
+
class basic_socket
|
43
|
+
: public basic_io_object<SocketService>,
|
44
|
+
public socket_base
|
45
|
+
{
|
46
|
+
public:
|
47
|
+
/// (Deprecated: Use native_handle_type.) The native representation of a
|
48
|
+
/// socket.
|
49
|
+
typedef typename SocketService::native_handle_type native_type;
|
50
|
+
|
51
|
+
/// The native representation of a socket.
|
52
|
+
typedef typename SocketService::native_handle_type native_handle_type;
|
53
|
+
|
54
|
+
/// The protocol type.
|
55
|
+
typedef Protocol protocol_type;
|
56
|
+
|
57
|
+
/// The endpoint type.
|
58
|
+
typedef typename Protocol::endpoint endpoint_type;
|
59
|
+
|
60
|
+
/// A basic_socket is always the lowest layer.
|
61
|
+
typedef basic_socket<Protocol, SocketService> lowest_layer_type;
|
62
|
+
|
63
|
+
/// Construct a basic_socket without opening it.
|
64
|
+
/**
|
65
|
+
* This constructor creates a socket without opening it.
|
66
|
+
*
|
67
|
+
* @param io_service The io_service object that the socket will use to
|
68
|
+
* dispatch handlers for any asynchronous operations performed on the socket.
|
69
|
+
*/
|
70
|
+
explicit basic_socket(boost::asio::io_service& io_service)
|
71
|
+
: basic_io_object<SocketService>(io_service)
|
72
|
+
{
|
73
|
+
}
|
74
|
+
|
75
|
+
/// Construct and open a basic_socket.
|
76
|
+
/**
|
77
|
+
* This constructor creates and opens a socket.
|
78
|
+
*
|
79
|
+
* @param io_service The io_service object that the socket will use to
|
80
|
+
* dispatch handlers for any asynchronous operations performed on the socket.
|
81
|
+
*
|
82
|
+
* @param protocol An object specifying protocol parameters to be used.
|
83
|
+
*
|
84
|
+
* @throws boost::system::system_error Thrown on failure.
|
85
|
+
*/
|
86
|
+
basic_socket(boost::asio::io_service& io_service,
|
87
|
+
const protocol_type& protocol)
|
88
|
+
: basic_io_object<SocketService>(io_service)
|
89
|
+
{
|
90
|
+
boost::system::error_code ec;
|
91
|
+
this->get_service().open(this->get_implementation(), protocol, ec);
|
92
|
+
boost::asio::detail::throw_error(ec, "open");
|
93
|
+
}
|
94
|
+
|
95
|
+
/// Construct a basic_socket, opening it and binding it to the given local
|
96
|
+
/// endpoint.
|
97
|
+
/**
|
98
|
+
* This constructor creates a socket and automatically opens it bound to the
|
99
|
+
* specified endpoint on the local machine. The protocol used is the protocol
|
100
|
+
* associated with the given endpoint.
|
101
|
+
*
|
102
|
+
* @param io_service The io_service object that the socket will use to
|
103
|
+
* dispatch handlers for any asynchronous operations performed on the socket.
|
104
|
+
*
|
105
|
+
* @param endpoint An endpoint on the local machine to which the socket will
|
106
|
+
* be bound.
|
107
|
+
*
|
108
|
+
* @throws boost::system::system_error Thrown on failure.
|
109
|
+
*/
|
110
|
+
basic_socket(boost::asio::io_service& io_service,
|
111
|
+
const endpoint_type& endpoint)
|
112
|
+
: basic_io_object<SocketService>(io_service)
|
113
|
+
{
|
114
|
+
boost::system::error_code ec;
|
115
|
+
const protocol_type protocol = endpoint.protocol();
|
116
|
+
this->get_service().open(this->get_implementation(), protocol, ec);
|
117
|
+
boost::asio::detail::throw_error(ec, "open");
|
118
|
+
this->get_service().bind(this->get_implementation(), endpoint, ec);
|
119
|
+
boost::asio::detail::throw_error(ec, "bind");
|
120
|
+
}
|
121
|
+
|
122
|
+
/// Construct a basic_socket on an existing native socket.
|
123
|
+
/**
|
124
|
+
* This constructor creates a socket object to hold an existing native socket.
|
125
|
+
*
|
126
|
+
* @param io_service The io_service object that the socket will use to
|
127
|
+
* dispatch handlers for any asynchronous operations performed on the socket.
|
128
|
+
*
|
129
|
+
* @param protocol An object specifying protocol parameters to be used.
|
130
|
+
*
|
131
|
+
* @param native_socket A native socket.
|
132
|
+
*
|
133
|
+
* @throws boost::system::system_error Thrown on failure.
|
134
|
+
*/
|
135
|
+
basic_socket(boost::asio::io_service& io_service,
|
136
|
+
const protocol_type& protocol, const native_handle_type& native_socket)
|
137
|
+
: basic_io_object<SocketService>(io_service)
|
138
|
+
{
|
139
|
+
boost::system::error_code ec;
|
140
|
+
this->get_service().assign(this->get_implementation(),
|
141
|
+
protocol, native_socket, ec);
|
142
|
+
boost::asio::detail::throw_error(ec, "assign");
|
143
|
+
}
|
144
|
+
|
145
|
+
#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
|
146
|
+
/// Move-construct a basic_socket from another.
|
147
|
+
/**
|
148
|
+
* This constructor moves a socket from one object to another.
|
149
|
+
*
|
150
|
+
* @param other The other basic_socket object from which the move will
|
151
|
+
* occur.
|
152
|
+
*
|
153
|
+
* @note Following the move, the moved-from object is in the same state as if
|
154
|
+
* constructed using the @c basic_socket(io_service&) constructor.
|
155
|
+
*/
|
156
|
+
basic_socket(basic_socket&& other)
|
157
|
+
: basic_io_object<SocketService>(
|
158
|
+
BOOST_ASIO_MOVE_CAST(basic_socket)(other))
|
159
|
+
{
|
160
|
+
}
|
161
|
+
|
162
|
+
/// Move-assign a basic_socket from another.
|
163
|
+
/**
|
164
|
+
* This assignment operator moves a socket from one object to another.
|
165
|
+
*
|
166
|
+
* @param other The other basic_socket object from which the move will
|
167
|
+
* occur.
|
168
|
+
*
|
169
|
+
* @note Following the move, the moved-from object is in the same state as if
|
170
|
+
* constructed using the @c basic_socket(io_service&) constructor.
|
171
|
+
*/
|
172
|
+
basic_socket& operator=(basic_socket&& other)
|
173
|
+
{
|
174
|
+
basic_io_object<SocketService>::operator=(
|
175
|
+
BOOST_ASIO_MOVE_CAST(basic_socket)(other));
|
176
|
+
return *this;
|
177
|
+
}
|
178
|
+
|
179
|
+
// All sockets have access to each other's implementations.
|
180
|
+
template <typename Protocol1, typename SocketService1>
|
181
|
+
friend class basic_socket;
|
182
|
+
|
183
|
+
/// Move-construct a basic_socket from a socket of another protocol type.
|
184
|
+
/**
|
185
|
+
* This constructor moves a socket from one object to another.
|
186
|
+
*
|
187
|
+
* @param other The other basic_socket object from which the move will
|
188
|
+
* occur.
|
189
|
+
*
|
190
|
+
* @note Following the move, the moved-from object is in the same state as if
|
191
|
+
* constructed using the @c basic_socket(io_service&) constructor.
|
192
|
+
*/
|
193
|
+
template <typename Protocol1, typename SocketService1>
|
194
|
+
basic_socket(basic_socket<Protocol1, SocketService1>&& other,
|
195
|
+
typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0)
|
196
|
+
: basic_io_object<SocketService>(
|
197
|
+
other.get_service(), other.get_implementation())
|
198
|
+
{
|
199
|
+
}
|
200
|
+
|
201
|
+
/// Move-assign a basic_socket from a socket of another protocol type.
|
202
|
+
/**
|
203
|
+
* This assignment operator moves a socket from one object to another.
|
204
|
+
*
|
205
|
+
* @param other The other basic_socket object from which the move will
|
206
|
+
* occur.
|
207
|
+
*
|
208
|
+
* @note Following the move, the moved-from object is in the same state as if
|
209
|
+
* constructed using the @c basic_socket(io_service&) constructor.
|
210
|
+
*/
|
211
|
+
template <typename Protocol1, typename SocketService1>
|
212
|
+
typename enable_if<is_convertible<Protocol1, Protocol>::value,
|
213
|
+
basic_socket>::type& operator=(
|
214
|
+
basic_socket<Protocol1, SocketService1>&& other)
|
215
|
+
{
|
216
|
+
basic_socket tmp(BOOST_ASIO_MOVE_CAST2(basic_socket<
|
217
|
+
Protocol1, SocketService1>)(other));
|
218
|
+
basic_io_object<SocketService>::operator=(
|
219
|
+
BOOST_ASIO_MOVE_CAST(basic_socket)(tmp));
|
220
|
+
return *this;
|
221
|
+
}
|
222
|
+
#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
|
223
|
+
|
224
|
+
/// Get a reference to the lowest layer.
|
225
|
+
/**
|
226
|
+
* This function returns a reference to the lowest layer in a stack of
|
227
|
+
* layers. Since a basic_socket cannot contain any further layers, it simply
|
228
|
+
* returns a reference to itself.
|
229
|
+
*
|
230
|
+
* @return A reference to the lowest layer in the stack of layers. Ownership
|
231
|
+
* is not transferred to the caller.
|
232
|
+
*/
|
233
|
+
lowest_layer_type& lowest_layer()
|
234
|
+
{
|
235
|
+
return *this;
|
236
|
+
}
|
237
|
+
|
238
|
+
/// Get a const reference to the lowest layer.
|
239
|
+
/**
|
240
|
+
* This function returns a const reference to the lowest layer in a stack of
|
241
|
+
* layers. Since a basic_socket cannot contain any further layers, it simply
|
242
|
+
* returns a reference to itself.
|
243
|
+
*
|
244
|
+
* @return A const reference to the lowest layer in the stack of layers.
|
245
|
+
* Ownership is not transferred to the caller.
|
246
|
+
*/
|
247
|
+
const lowest_layer_type& lowest_layer() const
|
248
|
+
{
|
249
|
+
return *this;
|
250
|
+
}
|
251
|
+
|
252
|
+
/// Open the socket using the specified protocol.
|
253
|
+
/**
|
254
|
+
* This function opens the socket so that it will use the specified protocol.
|
255
|
+
*
|
256
|
+
* @param protocol An object specifying protocol parameters to be used.
|
257
|
+
*
|
258
|
+
* @throws boost::system::system_error Thrown on failure.
|
259
|
+
*
|
260
|
+
* @par Example
|
261
|
+
* @code
|
262
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
263
|
+
* socket.open(boost::asio::ip::tcp::v4());
|
264
|
+
* @endcode
|
265
|
+
*/
|
266
|
+
void open(const protocol_type& protocol = protocol_type())
|
267
|
+
{
|
268
|
+
boost::system::error_code ec;
|
269
|
+
this->get_service().open(this->get_implementation(), protocol, ec);
|
270
|
+
boost::asio::detail::throw_error(ec, "open");
|
271
|
+
}
|
272
|
+
|
273
|
+
/// Open the socket using the specified protocol.
|
274
|
+
/**
|
275
|
+
* This function opens the socket so that it will use the specified protocol.
|
276
|
+
*
|
277
|
+
* @param protocol An object specifying which protocol is to be used.
|
278
|
+
*
|
279
|
+
* @param ec Set to indicate what error occurred, if any.
|
280
|
+
*
|
281
|
+
* @par Example
|
282
|
+
* @code
|
283
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
284
|
+
* boost::system::error_code ec;
|
285
|
+
* socket.open(boost::asio::ip::tcp::v4(), ec);
|
286
|
+
* if (ec)
|
287
|
+
* {
|
288
|
+
* // An error occurred.
|
289
|
+
* }
|
290
|
+
* @endcode
|
291
|
+
*/
|
292
|
+
boost::system::error_code open(const protocol_type& protocol,
|
293
|
+
boost::system::error_code& ec)
|
294
|
+
{
|
295
|
+
return this->get_service().open(this->get_implementation(), protocol, ec);
|
296
|
+
}
|
297
|
+
|
298
|
+
/// Assign an existing native socket to the socket.
|
299
|
+
/*
|
300
|
+
* This function opens the socket to hold an existing native socket.
|
301
|
+
*
|
302
|
+
* @param protocol An object specifying which protocol is to be used.
|
303
|
+
*
|
304
|
+
* @param native_socket A native socket.
|
305
|
+
*
|
306
|
+
* @throws boost::system::system_error Thrown on failure.
|
307
|
+
*/
|
308
|
+
void assign(const protocol_type& protocol,
|
309
|
+
const native_handle_type& native_socket)
|
310
|
+
{
|
311
|
+
boost::system::error_code ec;
|
312
|
+
this->get_service().assign(this->get_implementation(),
|
313
|
+
protocol, native_socket, ec);
|
314
|
+
boost::asio::detail::throw_error(ec, "assign");
|
315
|
+
}
|
316
|
+
|
317
|
+
/// Assign an existing native socket to the socket.
|
318
|
+
/*
|
319
|
+
* This function opens the socket to hold an existing native socket.
|
320
|
+
*
|
321
|
+
* @param protocol An object specifying which protocol is to be used.
|
322
|
+
*
|
323
|
+
* @param native_socket A native socket.
|
324
|
+
*
|
325
|
+
* @param ec Set to indicate what error occurred, if any.
|
326
|
+
*/
|
327
|
+
boost::system::error_code assign(const protocol_type& protocol,
|
328
|
+
const native_handle_type& native_socket, boost::system::error_code& ec)
|
329
|
+
{
|
330
|
+
return this->get_service().assign(this->get_implementation(),
|
331
|
+
protocol, native_socket, ec);
|
332
|
+
}
|
333
|
+
|
334
|
+
/// Determine whether the socket is open.
|
335
|
+
bool is_open() const
|
336
|
+
{
|
337
|
+
return this->get_service().is_open(this->get_implementation());
|
338
|
+
}
|
339
|
+
|
340
|
+
/// Close the socket.
|
341
|
+
/**
|
342
|
+
* This function is used to close the socket. Any asynchronous send, receive
|
343
|
+
* or connect operations will be cancelled immediately, and will complete
|
344
|
+
* with the boost::asio::error::operation_aborted error.
|
345
|
+
*
|
346
|
+
* @throws boost::system::system_error Thrown on failure. Note that, even if
|
347
|
+
* the function indicates an error, the underlying descriptor is closed.
|
348
|
+
*
|
349
|
+
* @note For portable behaviour with respect to graceful closure of a
|
350
|
+
* connected socket, call shutdown() before closing the socket.
|
351
|
+
*/
|
352
|
+
void close()
|
353
|
+
{
|
354
|
+
boost::system::error_code ec;
|
355
|
+
this->get_service().close(this->get_implementation(), ec);
|
356
|
+
boost::asio::detail::throw_error(ec, "close");
|
357
|
+
}
|
358
|
+
|
359
|
+
/// Close the socket.
|
360
|
+
/**
|
361
|
+
* This function is used to close the socket. Any asynchronous send, receive
|
362
|
+
* or connect operations will be cancelled immediately, and will complete
|
363
|
+
* with the boost::asio::error::operation_aborted error.
|
364
|
+
*
|
365
|
+
* @param ec Set to indicate what error occurred, if any. Note that, even if
|
366
|
+
* the function indicates an error, the underlying descriptor is closed.
|
367
|
+
*
|
368
|
+
* @par Example
|
369
|
+
* @code
|
370
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
371
|
+
* ...
|
372
|
+
* boost::system::error_code ec;
|
373
|
+
* socket.close(ec);
|
374
|
+
* if (ec)
|
375
|
+
* {
|
376
|
+
* // An error occurred.
|
377
|
+
* }
|
378
|
+
* @endcode
|
379
|
+
*
|
380
|
+
* @note For portable behaviour with respect to graceful closure of a
|
381
|
+
* connected socket, call shutdown() before closing the socket.
|
382
|
+
*/
|
383
|
+
boost::system::error_code close(boost::system::error_code& ec)
|
384
|
+
{
|
385
|
+
return this->get_service().close(this->get_implementation(), ec);
|
386
|
+
}
|
387
|
+
|
388
|
+
/// (Deprecated: Use native_handle().) Get the native socket representation.
|
389
|
+
/**
|
390
|
+
* This function may be used to obtain the underlying representation of the
|
391
|
+
* socket. This is intended to allow access to native socket functionality
|
392
|
+
* that is not otherwise provided.
|
393
|
+
*/
|
394
|
+
native_type native()
|
395
|
+
{
|
396
|
+
return this->get_service().native_handle(this->get_implementation());
|
397
|
+
}
|
398
|
+
|
399
|
+
/// Get the native socket representation.
|
400
|
+
/**
|
401
|
+
* This function may be used to obtain the underlying representation of the
|
402
|
+
* socket. This is intended to allow access to native socket functionality
|
403
|
+
* that is not otherwise provided.
|
404
|
+
*/
|
405
|
+
native_handle_type native_handle()
|
406
|
+
{
|
407
|
+
return this->get_service().native_handle(this->get_implementation());
|
408
|
+
}
|
409
|
+
|
410
|
+
/// Cancel all asynchronous operations associated with the socket.
|
411
|
+
/**
|
412
|
+
* This function causes all outstanding asynchronous connect, send and receive
|
413
|
+
* operations to finish immediately, and the handlers for cancelled operations
|
414
|
+
* will be passed the boost::asio::error::operation_aborted error.
|
415
|
+
*
|
416
|
+
* @throws boost::system::system_error Thrown on failure.
|
417
|
+
*
|
418
|
+
* @note Calls to cancel() will always fail with
|
419
|
+
* boost::asio::error::operation_not_supported when run on Windows XP, Windows
|
420
|
+
* Server 2003, and earlier versions of Windows, unless
|
421
|
+
* BOOST_ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has
|
422
|
+
* two issues that should be considered before enabling its use:
|
423
|
+
*
|
424
|
+
* @li It will only cancel asynchronous operations that were initiated in the
|
425
|
+
* current thread.
|
426
|
+
*
|
427
|
+
* @li It can appear to complete without error, but the request to cancel the
|
428
|
+
* unfinished operations may be silently ignored by the operating system.
|
429
|
+
* Whether it works or not seems to depend on the drivers that are installed.
|
430
|
+
*
|
431
|
+
* For portable cancellation, consider using one of the following
|
432
|
+
* alternatives:
|
433
|
+
*
|
434
|
+
* @li Disable asio's I/O completion port backend by defining
|
435
|
+
* BOOST_ASIO_DISABLE_IOCP.
|
436
|
+
*
|
437
|
+
* @li Use the close() function to simultaneously cancel the outstanding
|
438
|
+
* operations and close the socket.
|
439
|
+
*
|
440
|
+
* When running on Windows Vista, Windows Server 2008, and later, the
|
441
|
+
* CancelIoEx function is always used. This function does not have the
|
442
|
+
* problems described above.
|
443
|
+
*/
|
444
|
+
#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \
|
445
|
+
&& (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
|
446
|
+
&& !defined(BOOST_ASIO_ENABLE_CANCELIO)
|
447
|
+
__declspec(deprecated("By default, this function always fails with "
|
448
|
+
"operation_not_supported when used on Windows XP, Windows Server 2003, "
|
449
|
+
"or earlier. Consult documentation for details."))
|
450
|
+
#endif
|
451
|
+
void cancel()
|
452
|
+
{
|
453
|
+
boost::system::error_code ec;
|
454
|
+
this->get_service().cancel(this->get_implementation(), ec);
|
455
|
+
boost::asio::detail::throw_error(ec, "cancel");
|
456
|
+
}
|
457
|
+
|
458
|
+
/// Cancel all asynchronous operations associated with the socket.
|
459
|
+
/**
|
460
|
+
* This function causes all outstanding asynchronous connect, send and receive
|
461
|
+
* operations to finish immediately, and the handlers for cancelled operations
|
462
|
+
* will be passed the boost::asio::error::operation_aborted error.
|
463
|
+
*
|
464
|
+
* @param ec Set to indicate what error occurred, if any.
|
465
|
+
*
|
466
|
+
* @note Calls to cancel() will always fail with
|
467
|
+
* boost::asio::error::operation_not_supported when run on Windows XP, Windows
|
468
|
+
* Server 2003, and earlier versions of Windows, unless
|
469
|
+
* BOOST_ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has
|
470
|
+
* two issues that should be considered before enabling its use:
|
471
|
+
*
|
472
|
+
* @li It will only cancel asynchronous operations that were initiated in the
|
473
|
+
* current thread.
|
474
|
+
*
|
475
|
+
* @li It can appear to complete without error, but the request to cancel the
|
476
|
+
* unfinished operations may be silently ignored by the operating system.
|
477
|
+
* Whether it works or not seems to depend on the drivers that are installed.
|
478
|
+
*
|
479
|
+
* For portable cancellation, consider using one of the following
|
480
|
+
* alternatives:
|
481
|
+
*
|
482
|
+
* @li Disable asio's I/O completion port backend by defining
|
483
|
+
* BOOST_ASIO_DISABLE_IOCP.
|
484
|
+
*
|
485
|
+
* @li Use the close() function to simultaneously cancel the outstanding
|
486
|
+
* operations and close the socket.
|
487
|
+
*
|
488
|
+
* When running on Windows Vista, Windows Server 2008, and later, the
|
489
|
+
* CancelIoEx function is always used. This function does not have the
|
490
|
+
* problems described above.
|
491
|
+
*/
|
492
|
+
#if defined(BOOST_ASIO_MSVC) && (BOOST_ASIO_MSVC >= 1400) \
|
493
|
+
&& (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600) \
|
494
|
+
&& !defined(BOOST_ASIO_ENABLE_CANCELIO)
|
495
|
+
__declspec(deprecated("By default, this function always fails with "
|
496
|
+
"operation_not_supported when used on Windows XP, Windows Server 2003, "
|
497
|
+
"or earlier. Consult documentation for details."))
|
498
|
+
#endif
|
499
|
+
boost::system::error_code cancel(boost::system::error_code& ec)
|
500
|
+
{
|
501
|
+
return this->get_service().cancel(this->get_implementation(), ec);
|
502
|
+
}
|
503
|
+
|
504
|
+
/// Determine whether the socket is at the out-of-band data mark.
|
505
|
+
/**
|
506
|
+
* This function is used to check whether the socket input is currently
|
507
|
+
* positioned at the out-of-band data mark.
|
508
|
+
*
|
509
|
+
* @return A bool indicating whether the socket is at the out-of-band data
|
510
|
+
* mark.
|
511
|
+
*
|
512
|
+
* @throws boost::system::system_error Thrown on failure.
|
513
|
+
*/
|
514
|
+
bool at_mark() const
|
515
|
+
{
|
516
|
+
boost::system::error_code ec;
|
517
|
+
bool b = this->get_service().at_mark(this->get_implementation(), ec);
|
518
|
+
boost::asio::detail::throw_error(ec, "at_mark");
|
519
|
+
return b;
|
520
|
+
}
|
521
|
+
|
522
|
+
/// Determine whether the socket is at the out-of-band data mark.
|
523
|
+
/**
|
524
|
+
* This function is used to check whether the socket input is currently
|
525
|
+
* positioned at the out-of-band data mark.
|
526
|
+
*
|
527
|
+
* @param ec Set to indicate what error occurred, if any.
|
528
|
+
*
|
529
|
+
* @return A bool indicating whether the socket is at the out-of-band data
|
530
|
+
* mark.
|
531
|
+
*/
|
532
|
+
bool at_mark(boost::system::error_code& ec) const
|
533
|
+
{
|
534
|
+
return this->get_service().at_mark(this->get_implementation(), ec);
|
535
|
+
}
|
536
|
+
|
537
|
+
/// Determine the number of bytes available for reading.
|
538
|
+
/**
|
539
|
+
* This function is used to determine the number of bytes that may be read
|
540
|
+
* without blocking.
|
541
|
+
*
|
542
|
+
* @return The number of bytes that may be read without blocking, or 0 if an
|
543
|
+
* error occurs.
|
544
|
+
*
|
545
|
+
* @throws boost::system::system_error Thrown on failure.
|
546
|
+
*/
|
547
|
+
std::size_t available() const
|
548
|
+
{
|
549
|
+
boost::system::error_code ec;
|
550
|
+
std::size_t s = this->get_service().available(
|
551
|
+
this->get_implementation(), ec);
|
552
|
+
boost::asio::detail::throw_error(ec, "available");
|
553
|
+
return s;
|
554
|
+
}
|
555
|
+
|
556
|
+
/// Determine the number of bytes available for reading.
|
557
|
+
/**
|
558
|
+
* This function is used to determine the number of bytes that may be read
|
559
|
+
* without blocking.
|
560
|
+
*
|
561
|
+
* @param ec Set to indicate what error occurred, if any.
|
562
|
+
*
|
563
|
+
* @return The number of bytes that may be read without blocking, or 0 if an
|
564
|
+
* error occurs.
|
565
|
+
*/
|
566
|
+
std::size_t available(boost::system::error_code& ec) const
|
567
|
+
{
|
568
|
+
return this->get_service().available(this->get_implementation(), ec);
|
569
|
+
}
|
570
|
+
|
571
|
+
/// Bind the socket to the given local endpoint.
|
572
|
+
/**
|
573
|
+
* This function binds the socket to the specified endpoint on the local
|
574
|
+
* machine.
|
575
|
+
*
|
576
|
+
* @param endpoint An endpoint on the local machine to which the socket will
|
577
|
+
* be bound.
|
578
|
+
*
|
579
|
+
* @throws boost::system::system_error Thrown on failure.
|
580
|
+
*
|
581
|
+
* @par Example
|
582
|
+
* @code
|
583
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
584
|
+
* socket.open(boost::asio::ip::tcp::v4());
|
585
|
+
* socket.bind(boost::asio::ip::tcp::endpoint(
|
586
|
+
* boost::asio::ip::tcp::v4(), 12345));
|
587
|
+
* @endcode
|
588
|
+
*/
|
589
|
+
void bind(const endpoint_type& endpoint)
|
590
|
+
{
|
591
|
+
boost::system::error_code ec;
|
592
|
+
this->get_service().bind(this->get_implementation(), endpoint, ec);
|
593
|
+
boost::asio::detail::throw_error(ec, "bind");
|
594
|
+
}
|
595
|
+
|
596
|
+
/// Bind the socket to the given local endpoint.
|
597
|
+
/**
|
598
|
+
* This function binds the socket to the specified endpoint on the local
|
599
|
+
* machine.
|
600
|
+
*
|
601
|
+
* @param endpoint An endpoint on the local machine to which the socket will
|
602
|
+
* be bound.
|
603
|
+
*
|
604
|
+
* @param ec Set to indicate what error occurred, if any.
|
605
|
+
*
|
606
|
+
* @par Example
|
607
|
+
* @code
|
608
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
609
|
+
* socket.open(boost::asio::ip::tcp::v4());
|
610
|
+
* boost::system::error_code ec;
|
611
|
+
* socket.bind(boost::asio::ip::tcp::endpoint(
|
612
|
+
* boost::asio::ip::tcp::v4(), 12345), ec);
|
613
|
+
* if (ec)
|
614
|
+
* {
|
615
|
+
* // An error occurred.
|
616
|
+
* }
|
617
|
+
* @endcode
|
618
|
+
*/
|
619
|
+
boost::system::error_code bind(const endpoint_type& endpoint,
|
620
|
+
boost::system::error_code& ec)
|
621
|
+
{
|
622
|
+
return this->get_service().bind(this->get_implementation(), endpoint, ec);
|
623
|
+
}
|
624
|
+
|
625
|
+
/// Connect the socket to the specified endpoint.
|
626
|
+
/**
|
627
|
+
* This function is used to connect a socket to the specified remote endpoint.
|
628
|
+
* The function call will block until the connection is successfully made or
|
629
|
+
* an error occurs.
|
630
|
+
*
|
631
|
+
* The socket is automatically opened if it is not already open. If the
|
632
|
+
* connect fails, and the socket was automatically opened, the socket is
|
633
|
+
* not returned to the closed state.
|
634
|
+
*
|
635
|
+
* @param peer_endpoint The remote endpoint to which the socket will be
|
636
|
+
* connected.
|
637
|
+
*
|
638
|
+
* @throws boost::system::system_error Thrown on failure.
|
639
|
+
*
|
640
|
+
* @par Example
|
641
|
+
* @code
|
642
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
643
|
+
* boost::asio::ip::tcp::endpoint endpoint(
|
644
|
+
* boost::asio::ip::address::from_string("1.2.3.4"), 12345);
|
645
|
+
* socket.connect(endpoint);
|
646
|
+
* @endcode
|
647
|
+
*/
|
648
|
+
void connect(const endpoint_type& peer_endpoint)
|
649
|
+
{
|
650
|
+
boost::system::error_code ec;
|
651
|
+
if (!is_open())
|
652
|
+
{
|
653
|
+
this->get_service().open(this->get_implementation(),
|
654
|
+
peer_endpoint.protocol(), ec);
|
655
|
+
boost::asio::detail::throw_error(ec, "connect");
|
656
|
+
}
|
657
|
+
this->get_service().connect(this->get_implementation(), peer_endpoint, ec);
|
658
|
+
boost::asio::detail::throw_error(ec, "connect");
|
659
|
+
}
|
660
|
+
|
661
|
+
/// Connect the socket to the specified endpoint.
|
662
|
+
/**
|
663
|
+
* This function is used to connect a socket to the specified remote endpoint.
|
664
|
+
* The function call will block until the connection is successfully made or
|
665
|
+
* an error occurs.
|
666
|
+
*
|
667
|
+
* The socket is automatically opened if it is not already open. If the
|
668
|
+
* connect fails, and the socket was automatically opened, the socket is
|
669
|
+
* not returned to the closed state.
|
670
|
+
*
|
671
|
+
* @param peer_endpoint The remote endpoint to which the socket will be
|
672
|
+
* connected.
|
673
|
+
*
|
674
|
+
* @param ec Set to indicate what error occurred, if any.
|
675
|
+
*
|
676
|
+
* @par Example
|
677
|
+
* @code
|
678
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
679
|
+
* boost::asio::ip::tcp::endpoint endpoint(
|
680
|
+
* boost::asio::ip::address::from_string("1.2.3.4"), 12345);
|
681
|
+
* boost::system::error_code ec;
|
682
|
+
* socket.connect(endpoint, ec);
|
683
|
+
* if (ec)
|
684
|
+
* {
|
685
|
+
* // An error occurred.
|
686
|
+
* }
|
687
|
+
* @endcode
|
688
|
+
*/
|
689
|
+
boost::system::error_code connect(const endpoint_type& peer_endpoint,
|
690
|
+
boost::system::error_code& ec)
|
691
|
+
{
|
692
|
+
if (!is_open())
|
693
|
+
{
|
694
|
+
if (this->get_service().open(this->get_implementation(),
|
695
|
+
peer_endpoint.protocol(), ec))
|
696
|
+
{
|
697
|
+
return ec;
|
698
|
+
}
|
699
|
+
}
|
700
|
+
|
701
|
+
return this->get_service().connect(
|
702
|
+
this->get_implementation(), peer_endpoint, ec);
|
703
|
+
}
|
704
|
+
|
705
|
+
/// Start an asynchronous connect.
|
706
|
+
/**
|
707
|
+
* This function is used to asynchronously connect a socket to the specified
|
708
|
+
* remote endpoint. The function call always returns immediately.
|
709
|
+
*
|
710
|
+
* The socket is automatically opened if it is not already open. If the
|
711
|
+
* connect fails, and the socket was automatically opened, the socket is
|
712
|
+
* not returned to the closed state.
|
713
|
+
*
|
714
|
+
* @param peer_endpoint The remote endpoint to which the socket will be
|
715
|
+
* connected. Copies will be made of the endpoint object as required.
|
716
|
+
*
|
717
|
+
* @param handler The handler to be called when the connection operation
|
718
|
+
* completes. Copies will be made of the handler as required. The function
|
719
|
+
* signature of the handler must be:
|
720
|
+
* @code void handler(
|
721
|
+
* const boost::system::error_code& error // Result of operation
|
722
|
+
* ); @endcode
|
723
|
+
* Regardless of whether the asynchronous operation completes immediately or
|
724
|
+
* not, the handler will not be invoked from within this function. Invocation
|
725
|
+
* of the handler will be performed in a manner equivalent to using
|
726
|
+
* boost::asio::io_service::post().
|
727
|
+
*
|
728
|
+
* @par Example
|
729
|
+
* @code
|
730
|
+
* void connect_handler(const boost::system::error_code& error)
|
731
|
+
* {
|
732
|
+
* if (!error)
|
733
|
+
* {
|
734
|
+
* // Connect succeeded.
|
735
|
+
* }
|
736
|
+
* }
|
737
|
+
*
|
738
|
+
* ...
|
739
|
+
*
|
740
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
741
|
+
* boost::asio::ip::tcp::endpoint endpoint(
|
742
|
+
* boost::asio::ip::address::from_string("1.2.3.4"), 12345);
|
743
|
+
* socket.async_connect(endpoint, connect_handler);
|
744
|
+
* @endcode
|
745
|
+
*/
|
746
|
+
template <typename ConnectHandler>
|
747
|
+
BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler,
|
748
|
+
void (boost::system::error_code))
|
749
|
+
async_connect(const endpoint_type& peer_endpoint,
|
750
|
+
BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
|
751
|
+
{
|
752
|
+
// If you get an error on the following line it means that your handler does
|
753
|
+
// not meet the documented type requirements for a ConnectHandler.
|
754
|
+
BOOST_ASIO_CONNECT_HANDLER_CHECK(ConnectHandler, handler) type_check;
|
755
|
+
|
756
|
+
if (!is_open())
|
757
|
+
{
|
758
|
+
boost::system::error_code ec;
|
759
|
+
const protocol_type protocol = peer_endpoint.protocol();
|
760
|
+
if (this->get_service().open(this->get_implementation(), protocol, ec))
|
761
|
+
{
|
762
|
+
detail::async_result_init<
|
763
|
+
ConnectHandler, void (boost::system::error_code)> init(
|
764
|
+
BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
|
765
|
+
|
766
|
+
this->get_io_service().post(
|
767
|
+
boost::asio::detail::bind_handler(
|
768
|
+
BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE(
|
769
|
+
ConnectHandler, void (boost::system::error_code)))(
|
770
|
+
init.handler), ec));
|
771
|
+
|
772
|
+
return init.result.get();
|
773
|
+
}
|
774
|
+
}
|
775
|
+
|
776
|
+
return this->get_service().async_connect(this->get_implementation(),
|
777
|
+
peer_endpoint, BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler));
|
778
|
+
}
|
779
|
+
|
780
|
+
/// Set an option on the socket.
|
781
|
+
/**
|
782
|
+
* This function is used to set an option on the socket.
|
783
|
+
*
|
784
|
+
* @param option The new option value to be set on the socket.
|
785
|
+
*
|
786
|
+
* @throws boost::system::system_error Thrown on failure.
|
787
|
+
*
|
788
|
+
* @sa SettableSocketOption @n
|
789
|
+
* boost::asio::socket_base::broadcast @n
|
790
|
+
* boost::asio::socket_base::do_not_route @n
|
791
|
+
* boost::asio::socket_base::keep_alive @n
|
792
|
+
* boost::asio::socket_base::linger @n
|
793
|
+
* boost::asio::socket_base::receive_buffer_size @n
|
794
|
+
* boost::asio::socket_base::receive_low_watermark @n
|
795
|
+
* boost::asio::socket_base::reuse_address @n
|
796
|
+
* boost::asio::socket_base::send_buffer_size @n
|
797
|
+
* boost::asio::socket_base::send_low_watermark @n
|
798
|
+
* boost::asio::ip::multicast::join_group @n
|
799
|
+
* boost::asio::ip::multicast::leave_group @n
|
800
|
+
* boost::asio::ip::multicast::enable_loopback @n
|
801
|
+
* boost::asio::ip::multicast::outbound_interface @n
|
802
|
+
* boost::asio::ip::multicast::hops @n
|
803
|
+
* boost::asio::ip::tcp::no_delay
|
804
|
+
*
|
805
|
+
* @par Example
|
806
|
+
* Setting the IPPROTO_TCP/TCP_NODELAY option:
|
807
|
+
* @code
|
808
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
809
|
+
* ...
|
810
|
+
* boost::asio::ip::tcp::no_delay option(true);
|
811
|
+
* socket.set_option(option);
|
812
|
+
* @endcode
|
813
|
+
*/
|
814
|
+
template <typename SettableSocketOption>
|
815
|
+
void set_option(const SettableSocketOption& option)
|
816
|
+
{
|
817
|
+
boost::system::error_code ec;
|
818
|
+
this->get_service().set_option(this->get_implementation(), option, ec);
|
819
|
+
boost::asio::detail::throw_error(ec, "set_option");
|
820
|
+
}
|
821
|
+
|
822
|
+
/// Set an option on the socket.
|
823
|
+
/**
|
824
|
+
* This function is used to set an option on the socket.
|
825
|
+
*
|
826
|
+
* @param option The new option value to be set on the socket.
|
827
|
+
*
|
828
|
+
* @param ec Set to indicate what error occurred, if any.
|
829
|
+
*
|
830
|
+
* @sa SettableSocketOption @n
|
831
|
+
* boost::asio::socket_base::broadcast @n
|
832
|
+
* boost::asio::socket_base::do_not_route @n
|
833
|
+
* boost::asio::socket_base::keep_alive @n
|
834
|
+
* boost::asio::socket_base::linger @n
|
835
|
+
* boost::asio::socket_base::receive_buffer_size @n
|
836
|
+
* boost::asio::socket_base::receive_low_watermark @n
|
837
|
+
* boost::asio::socket_base::reuse_address @n
|
838
|
+
* boost::asio::socket_base::send_buffer_size @n
|
839
|
+
* boost::asio::socket_base::send_low_watermark @n
|
840
|
+
* boost::asio::ip::multicast::join_group @n
|
841
|
+
* boost::asio::ip::multicast::leave_group @n
|
842
|
+
* boost::asio::ip::multicast::enable_loopback @n
|
843
|
+
* boost::asio::ip::multicast::outbound_interface @n
|
844
|
+
* boost::asio::ip::multicast::hops @n
|
845
|
+
* boost::asio::ip::tcp::no_delay
|
846
|
+
*
|
847
|
+
* @par Example
|
848
|
+
* Setting the IPPROTO_TCP/TCP_NODELAY option:
|
849
|
+
* @code
|
850
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
851
|
+
* ...
|
852
|
+
* boost::asio::ip::tcp::no_delay option(true);
|
853
|
+
* boost::system::error_code ec;
|
854
|
+
* socket.set_option(option, ec);
|
855
|
+
* if (ec)
|
856
|
+
* {
|
857
|
+
* // An error occurred.
|
858
|
+
* }
|
859
|
+
* @endcode
|
860
|
+
*/
|
861
|
+
template <typename SettableSocketOption>
|
862
|
+
boost::system::error_code set_option(const SettableSocketOption& option,
|
863
|
+
boost::system::error_code& ec)
|
864
|
+
{
|
865
|
+
return this->get_service().set_option(
|
866
|
+
this->get_implementation(), option, ec);
|
867
|
+
}
|
868
|
+
|
869
|
+
/// Get an option from the socket.
|
870
|
+
/**
|
871
|
+
* This function is used to get the current value of an option on the socket.
|
872
|
+
*
|
873
|
+
* @param option The option value to be obtained from the socket.
|
874
|
+
*
|
875
|
+
* @throws boost::system::system_error Thrown on failure.
|
876
|
+
*
|
877
|
+
* @sa GettableSocketOption @n
|
878
|
+
* boost::asio::socket_base::broadcast @n
|
879
|
+
* boost::asio::socket_base::do_not_route @n
|
880
|
+
* boost::asio::socket_base::keep_alive @n
|
881
|
+
* boost::asio::socket_base::linger @n
|
882
|
+
* boost::asio::socket_base::receive_buffer_size @n
|
883
|
+
* boost::asio::socket_base::receive_low_watermark @n
|
884
|
+
* boost::asio::socket_base::reuse_address @n
|
885
|
+
* boost::asio::socket_base::send_buffer_size @n
|
886
|
+
* boost::asio::socket_base::send_low_watermark @n
|
887
|
+
* boost::asio::ip::multicast::join_group @n
|
888
|
+
* boost::asio::ip::multicast::leave_group @n
|
889
|
+
* boost::asio::ip::multicast::enable_loopback @n
|
890
|
+
* boost::asio::ip::multicast::outbound_interface @n
|
891
|
+
* boost::asio::ip::multicast::hops @n
|
892
|
+
* boost::asio::ip::tcp::no_delay
|
893
|
+
*
|
894
|
+
* @par Example
|
895
|
+
* Getting the value of the SOL_SOCKET/SO_KEEPALIVE option:
|
896
|
+
* @code
|
897
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
898
|
+
* ...
|
899
|
+
* boost::asio::ip::tcp::socket::keep_alive option;
|
900
|
+
* socket.get_option(option);
|
901
|
+
* bool is_set = option.value();
|
902
|
+
* @endcode
|
903
|
+
*/
|
904
|
+
template <typename GettableSocketOption>
|
905
|
+
void get_option(GettableSocketOption& option) const
|
906
|
+
{
|
907
|
+
boost::system::error_code ec;
|
908
|
+
this->get_service().get_option(this->get_implementation(), option, ec);
|
909
|
+
boost::asio::detail::throw_error(ec, "get_option");
|
910
|
+
}
|
911
|
+
|
912
|
+
/// Get an option from the socket.
|
913
|
+
/**
|
914
|
+
* This function is used to get the current value of an option on the socket.
|
915
|
+
*
|
916
|
+
* @param option The option value to be obtained from the socket.
|
917
|
+
*
|
918
|
+
* @param ec Set to indicate what error occurred, if any.
|
919
|
+
*
|
920
|
+
* @sa GettableSocketOption @n
|
921
|
+
* boost::asio::socket_base::broadcast @n
|
922
|
+
* boost::asio::socket_base::do_not_route @n
|
923
|
+
* boost::asio::socket_base::keep_alive @n
|
924
|
+
* boost::asio::socket_base::linger @n
|
925
|
+
* boost::asio::socket_base::receive_buffer_size @n
|
926
|
+
* boost::asio::socket_base::receive_low_watermark @n
|
927
|
+
* boost::asio::socket_base::reuse_address @n
|
928
|
+
* boost::asio::socket_base::send_buffer_size @n
|
929
|
+
* boost::asio::socket_base::send_low_watermark @n
|
930
|
+
* boost::asio::ip::multicast::join_group @n
|
931
|
+
* boost::asio::ip::multicast::leave_group @n
|
932
|
+
* boost::asio::ip::multicast::enable_loopback @n
|
933
|
+
* boost::asio::ip::multicast::outbound_interface @n
|
934
|
+
* boost::asio::ip::multicast::hops @n
|
935
|
+
* boost::asio::ip::tcp::no_delay
|
936
|
+
*
|
937
|
+
* @par Example
|
938
|
+
* Getting the value of the SOL_SOCKET/SO_KEEPALIVE option:
|
939
|
+
* @code
|
940
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
941
|
+
* ...
|
942
|
+
* boost::asio::ip::tcp::socket::keep_alive option;
|
943
|
+
* boost::system::error_code ec;
|
944
|
+
* socket.get_option(option, ec);
|
945
|
+
* if (ec)
|
946
|
+
* {
|
947
|
+
* // An error occurred.
|
948
|
+
* }
|
949
|
+
* bool is_set = option.value();
|
950
|
+
* @endcode
|
951
|
+
*/
|
952
|
+
template <typename GettableSocketOption>
|
953
|
+
boost::system::error_code get_option(GettableSocketOption& option,
|
954
|
+
boost::system::error_code& ec) const
|
955
|
+
{
|
956
|
+
return this->get_service().get_option(
|
957
|
+
this->get_implementation(), option, ec);
|
958
|
+
}
|
959
|
+
|
960
|
+
/// Perform an IO control command on the socket.
|
961
|
+
/**
|
962
|
+
* This function is used to execute an IO control command on the socket.
|
963
|
+
*
|
964
|
+
* @param command The IO control command to be performed on the socket.
|
965
|
+
*
|
966
|
+
* @throws boost::system::system_error Thrown on failure.
|
967
|
+
*
|
968
|
+
* @sa IoControlCommand @n
|
969
|
+
* boost::asio::socket_base::bytes_readable @n
|
970
|
+
* boost::asio::socket_base::non_blocking_io
|
971
|
+
*
|
972
|
+
* @par Example
|
973
|
+
* Getting the number of bytes ready to read:
|
974
|
+
* @code
|
975
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
976
|
+
* ...
|
977
|
+
* boost::asio::ip::tcp::socket::bytes_readable command;
|
978
|
+
* socket.io_control(command);
|
979
|
+
* std::size_t bytes_readable = command.get();
|
980
|
+
* @endcode
|
981
|
+
*/
|
982
|
+
template <typename IoControlCommand>
|
983
|
+
void io_control(IoControlCommand& command)
|
984
|
+
{
|
985
|
+
boost::system::error_code ec;
|
986
|
+
this->get_service().io_control(this->get_implementation(), command, ec);
|
987
|
+
boost::asio::detail::throw_error(ec, "io_control");
|
988
|
+
}
|
989
|
+
|
990
|
+
/// Perform an IO control command on the socket.
|
991
|
+
/**
|
992
|
+
* This function is used to execute an IO control command on the socket.
|
993
|
+
*
|
994
|
+
* @param command The IO control command to be performed on the socket.
|
995
|
+
*
|
996
|
+
* @param ec Set to indicate what error occurred, if any.
|
997
|
+
*
|
998
|
+
* @sa IoControlCommand @n
|
999
|
+
* boost::asio::socket_base::bytes_readable @n
|
1000
|
+
* boost::asio::socket_base::non_blocking_io
|
1001
|
+
*
|
1002
|
+
* @par Example
|
1003
|
+
* Getting the number of bytes ready to read:
|
1004
|
+
* @code
|
1005
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
1006
|
+
* ...
|
1007
|
+
* boost::asio::ip::tcp::socket::bytes_readable command;
|
1008
|
+
* boost::system::error_code ec;
|
1009
|
+
* socket.io_control(command, ec);
|
1010
|
+
* if (ec)
|
1011
|
+
* {
|
1012
|
+
* // An error occurred.
|
1013
|
+
* }
|
1014
|
+
* std::size_t bytes_readable = command.get();
|
1015
|
+
* @endcode
|
1016
|
+
*/
|
1017
|
+
template <typename IoControlCommand>
|
1018
|
+
boost::system::error_code io_control(IoControlCommand& command,
|
1019
|
+
boost::system::error_code& ec)
|
1020
|
+
{
|
1021
|
+
return this->get_service().io_control(
|
1022
|
+
this->get_implementation(), command, ec);
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
/// Gets the non-blocking mode of the socket.
|
1026
|
+
/**
|
1027
|
+
* @returns @c true if the socket's synchronous operations will fail with
|
1028
|
+
* boost::asio::error::would_block if they are unable to perform the requested
|
1029
|
+
* operation immediately. If @c false, synchronous operations will block
|
1030
|
+
* until complete.
|
1031
|
+
*
|
1032
|
+
* @note The non-blocking mode has no effect on the behaviour of asynchronous
|
1033
|
+
* operations. Asynchronous operations will never fail with the error
|
1034
|
+
* boost::asio::error::would_block.
|
1035
|
+
*/
|
1036
|
+
bool non_blocking() const
|
1037
|
+
{
|
1038
|
+
return this->get_service().non_blocking(this->get_implementation());
|
1039
|
+
}
|
1040
|
+
|
1041
|
+
/// Sets the non-blocking mode of the socket.
|
1042
|
+
/**
|
1043
|
+
* @param mode If @c true, the socket's synchronous operations will fail with
|
1044
|
+
* boost::asio::error::would_block if they are unable to perform the requested
|
1045
|
+
* operation immediately. If @c false, synchronous operations will block
|
1046
|
+
* until complete.
|
1047
|
+
*
|
1048
|
+
* @throws boost::system::system_error Thrown on failure.
|
1049
|
+
*
|
1050
|
+
* @note The non-blocking mode has no effect on the behaviour of asynchronous
|
1051
|
+
* operations. Asynchronous operations will never fail with the error
|
1052
|
+
* boost::asio::error::would_block.
|
1053
|
+
*/
|
1054
|
+
void non_blocking(bool mode)
|
1055
|
+
{
|
1056
|
+
boost::system::error_code ec;
|
1057
|
+
this->get_service().non_blocking(this->get_implementation(), mode, ec);
|
1058
|
+
boost::asio::detail::throw_error(ec, "non_blocking");
|
1059
|
+
}
|
1060
|
+
|
1061
|
+
/// Sets the non-blocking mode of the socket.
|
1062
|
+
/**
|
1063
|
+
* @param mode If @c true, the socket's synchronous operations will fail with
|
1064
|
+
* boost::asio::error::would_block if they are unable to perform the requested
|
1065
|
+
* operation immediately. If @c false, synchronous operations will block
|
1066
|
+
* until complete.
|
1067
|
+
*
|
1068
|
+
* @param ec Set to indicate what error occurred, if any.
|
1069
|
+
*
|
1070
|
+
* @note The non-blocking mode has no effect on the behaviour of asynchronous
|
1071
|
+
* operations. Asynchronous operations will never fail with the error
|
1072
|
+
* boost::asio::error::would_block.
|
1073
|
+
*/
|
1074
|
+
boost::system::error_code non_blocking(
|
1075
|
+
bool mode, boost::system::error_code& ec)
|
1076
|
+
{
|
1077
|
+
return this->get_service().non_blocking(
|
1078
|
+
this->get_implementation(), mode, ec);
|
1079
|
+
}
|
1080
|
+
|
1081
|
+
/// Gets the non-blocking mode of the native socket implementation.
|
1082
|
+
/**
|
1083
|
+
* This function is used to retrieve the non-blocking mode of the underlying
|
1084
|
+
* native socket. This mode has no effect on the behaviour of the socket
|
1085
|
+
* object's synchronous operations.
|
1086
|
+
*
|
1087
|
+
* @returns @c true if the underlying socket is in non-blocking mode and
|
1088
|
+
* direct system calls may fail with boost::asio::error::would_block (or the
|
1089
|
+
* equivalent system error).
|
1090
|
+
*
|
1091
|
+
* @note The current non-blocking mode is cached by the socket object.
|
1092
|
+
* Consequently, the return value may be incorrect if the non-blocking mode
|
1093
|
+
* was set directly on the native socket.
|
1094
|
+
*
|
1095
|
+
* @par Example
|
1096
|
+
* This function is intended to allow the encapsulation of arbitrary
|
1097
|
+
* non-blocking system calls as asynchronous operations, in a way that is
|
1098
|
+
* transparent to the user of the socket object. The following example
|
1099
|
+
* illustrates how Linux's @c sendfile system call might be encapsulated:
|
1100
|
+
* @code template <typename Handler>
|
1101
|
+
* struct sendfile_op
|
1102
|
+
* {
|
1103
|
+
* tcp::socket& sock_;
|
1104
|
+
* int fd_;
|
1105
|
+
* Handler handler_;
|
1106
|
+
* off_t offset_;
|
1107
|
+
* std::size_t total_bytes_transferred_;
|
1108
|
+
*
|
1109
|
+
* // Function call operator meeting WriteHandler requirements.
|
1110
|
+
* // Used as the handler for the async_write_some operation.
|
1111
|
+
* void operator()(boost::system::error_code ec, std::size_t)
|
1112
|
+
* {
|
1113
|
+
* // Put the underlying socket into non-blocking mode.
|
1114
|
+
* if (!ec)
|
1115
|
+
* if (!sock_.native_non_blocking())
|
1116
|
+
* sock_.native_non_blocking(true, ec);
|
1117
|
+
*
|
1118
|
+
* if (!ec)
|
1119
|
+
* {
|
1120
|
+
* for (;;)
|
1121
|
+
* {
|
1122
|
+
* // Try the system call.
|
1123
|
+
* errno = 0;
|
1124
|
+
* int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
|
1125
|
+
* ec = boost::system::error_code(n < 0 ? errno : 0,
|
1126
|
+
* boost::asio::error::get_system_category());
|
1127
|
+
* total_bytes_transferred_ += ec ? 0 : n;
|
1128
|
+
*
|
1129
|
+
* // Retry operation immediately if interrupted by signal.
|
1130
|
+
* if (ec == boost::asio::error::interrupted)
|
1131
|
+
* continue;
|
1132
|
+
*
|
1133
|
+
* // Check if we need to run the operation again.
|
1134
|
+
* if (ec == boost::asio::error::would_block
|
1135
|
+
* || ec == boost::asio::error::try_again)
|
1136
|
+
* {
|
1137
|
+
* // We have to wait for the socket to become ready again.
|
1138
|
+
* sock_.async_write_some(boost::asio::null_buffers(), *this);
|
1139
|
+
* return;
|
1140
|
+
* }
|
1141
|
+
*
|
1142
|
+
* if (ec || n == 0)
|
1143
|
+
* {
|
1144
|
+
* // An error occurred, or we have reached the end of the file.
|
1145
|
+
* // Either way we must exit the loop so we can call the handler.
|
1146
|
+
* break;
|
1147
|
+
* }
|
1148
|
+
*
|
1149
|
+
* // Loop around to try calling sendfile again.
|
1150
|
+
* }
|
1151
|
+
* }
|
1152
|
+
*
|
1153
|
+
* // Pass result back to user's handler.
|
1154
|
+
* handler_(ec, total_bytes_transferred_);
|
1155
|
+
* }
|
1156
|
+
* };
|
1157
|
+
*
|
1158
|
+
* template <typename Handler>
|
1159
|
+
* void async_sendfile(tcp::socket& sock, int fd, Handler h)
|
1160
|
+
* {
|
1161
|
+
* sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
|
1162
|
+
* sock.async_write_some(boost::asio::null_buffers(), op);
|
1163
|
+
* } @endcode
|
1164
|
+
*/
|
1165
|
+
bool native_non_blocking() const
|
1166
|
+
{
|
1167
|
+
return this->get_service().native_non_blocking(this->get_implementation());
|
1168
|
+
}
|
1169
|
+
|
1170
|
+
/// Sets the non-blocking mode of the native socket implementation.
|
1171
|
+
/**
|
1172
|
+
* This function is used to modify the non-blocking mode of the underlying
|
1173
|
+
* native socket. It has no effect on the behaviour of the socket object's
|
1174
|
+
* synchronous operations.
|
1175
|
+
*
|
1176
|
+
* @param mode If @c true, the underlying socket is put into non-blocking
|
1177
|
+
* mode and direct system calls may fail with boost::asio::error::would_block
|
1178
|
+
* (or the equivalent system error).
|
1179
|
+
*
|
1180
|
+
* @throws boost::system::system_error Thrown on failure. If the @c mode is
|
1181
|
+
* @c false, but the current value of @c non_blocking() is @c true, this
|
1182
|
+
* function fails with boost::asio::error::invalid_argument, as the
|
1183
|
+
* combination does not make sense.
|
1184
|
+
*
|
1185
|
+
* @par Example
|
1186
|
+
* This function is intended to allow the encapsulation of arbitrary
|
1187
|
+
* non-blocking system calls as asynchronous operations, in a way that is
|
1188
|
+
* transparent to the user of the socket object. The following example
|
1189
|
+
* illustrates how Linux's @c sendfile system call might be encapsulated:
|
1190
|
+
* @code template <typename Handler>
|
1191
|
+
* struct sendfile_op
|
1192
|
+
* {
|
1193
|
+
* tcp::socket& sock_;
|
1194
|
+
* int fd_;
|
1195
|
+
* Handler handler_;
|
1196
|
+
* off_t offset_;
|
1197
|
+
* std::size_t total_bytes_transferred_;
|
1198
|
+
*
|
1199
|
+
* // Function call operator meeting WriteHandler requirements.
|
1200
|
+
* // Used as the handler for the async_write_some operation.
|
1201
|
+
* void operator()(boost::system::error_code ec, std::size_t)
|
1202
|
+
* {
|
1203
|
+
* // Put the underlying socket into non-blocking mode.
|
1204
|
+
* if (!ec)
|
1205
|
+
* if (!sock_.native_non_blocking())
|
1206
|
+
* sock_.native_non_blocking(true, ec);
|
1207
|
+
*
|
1208
|
+
* if (!ec)
|
1209
|
+
* {
|
1210
|
+
* for (;;)
|
1211
|
+
* {
|
1212
|
+
* // Try the system call.
|
1213
|
+
* errno = 0;
|
1214
|
+
* int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
|
1215
|
+
* ec = boost::system::error_code(n < 0 ? errno : 0,
|
1216
|
+
* boost::asio::error::get_system_category());
|
1217
|
+
* total_bytes_transferred_ += ec ? 0 : n;
|
1218
|
+
*
|
1219
|
+
* // Retry operation immediately if interrupted by signal.
|
1220
|
+
* if (ec == boost::asio::error::interrupted)
|
1221
|
+
* continue;
|
1222
|
+
*
|
1223
|
+
* // Check if we need to run the operation again.
|
1224
|
+
* if (ec == boost::asio::error::would_block
|
1225
|
+
* || ec == boost::asio::error::try_again)
|
1226
|
+
* {
|
1227
|
+
* // We have to wait for the socket to become ready again.
|
1228
|
+
* sock_.async_write_some(boost::asio::null_buffers(), *this);
|
1229
|
+
* return;
|
1230
|
+
* }
|
1231
|
+
*
|
1232
|
+
* if (ec || n == 0)
|
1233
|
+
* {
|
1234
|
+
* // An error occurred, or we have reached the end of the file.
|
1235
|
+
* // Either way we must exit the loop so we can call the handler.
|
1236
|
+
* break;
|
1237
|
+
* }
|
1238
|
+
*
|
1239
|
+
* // Loop around to try calling sendfile again.
|
1240
|
+
* }
|
1241
|
+
* }
|
1242
|
+
*
|
1243
|
+
* // Pass result back to user's handler.
|
1244
|
+
* handler_(ec, total_bytes_transferred_);
|
1245
|
+
* }
|
1246
|
+
* };
|
1247
|
+
*
|
1248
|
+
* template <typename Handler>
|
1249
|
+
* void async_sendfile(tcp::socket& sock, int fd, Handler h)
|
1250
|
+
* {
|
1251
|
+
* sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
|
1252
|
+
* sock.async_write_some(boost::asio::null_buffers(), op);
|
1253
|
+
* } @endcode
|
1254
|
+
*/
|
1255
|
+
void native_non_blocking(bool mode)
|
1256
|
+
{
|
1257
|
+
boost::system::error_code ec;
|
1258
|
+
this->get_service().native_non_blocking(
|
1259
|
+
this->get_implementation(), mode, ec);
|
1260
|
+
boost::asio::detail::throw_error(ec, "native_non_blocking");
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
/// Sets the non-blocking mode of the native socket implementation.
|
1264
|
+
/**
|
1265
|
+
* This function is used to modify the non-blocking mode of the underlying
|
1266
|
+
* native socket. It has no effect on the behaviour of the socket object's
|
1267
|
+
* synchronous operations.
|
1268
|
+
*
|
1269
|
+
* @param mode If @c true, the underlying socket is put into non-blocking
|
1270
|
+
* mode and direct system calls may fail with boost::asio::error::would_block
|
1271
|
+
* (or the equivalent system error).
|
1272
|
+
*
|
1273
|
+
* @param ec Set to indicate what error occurred, if any. If the @c mode is
|
1274
|
+
* @c false, but the current value of @c non_blocking() is @c true, this
|
1275
|
+
* function fails with boost::asio::error::invalid_argument, as the
|
1276
|
+
* combination does not make sense.
|
1277
|
+
*
|
1278
|
+
* @par Example
|
1279
|
+
* This function is intended to allow the encapsulation of arbitrary
|
1280
|
+
* non-blocking system calls as asynchronous operations, in a way that is
|
1281
|
+
* transparent to the user of the socket object. The following example
|
1282
|
+
* illustrates how Linux's @c sendfile system call might be encapsulated:
|
1283
|
+
* @code template <typename Handler>
|
1284
|
+
* struct sendfile_op
|
1285
|
+
* {
|
1286
|
+
* tcp::socket& sock_;
|
1287
|
+
* int fd_;
|
1288
|
+
* Handler handler_;
|
1289
|
+
* off_t offset_;
|
1290
|
+
* std::size_t total_bytes_transferred_;
|
1291
|
+
*
|
1292
|
+
* // Function call operator meeting WriteHandler requirements.
|
1293
|
+
* // Used as the handler for the async_write_some operation.
|
1294
|
+
* void operator()(boost::system::error_code ec, std::size_t)
|
1295
|
+
* {
|
1296
|
+
* // Put the underlying socket into non-blocking mode.
|
1297
|
+
* if (!ec)
|
1298
|
+
* if (!sock_.native_non_blocking())
|
1299
|
+
* sock_.native_non_blocking(true, ec);
|
1300
|
+
*
|
1301
|
+
* if (!ec)
|
1302
|
+
* {
|
1303
|
+
* for (;;)
|
1304
|
+
* {
|
1305
|
+
* // Try the system call.
|
1306
|
+
* errno = 0;
|
1307
|
+
* int n = ::sendfile(sock_.native_handle(), fd_, &offset_, 65536);
|
1308
|
+
* ec = boost::system::error_code(n < 0 ? errno : 0,
|
1309
|
+
* boost::asio::error::get_system_category());
|
1310
|
+
* total_bytes_transferred_ += ec ? 0 : n;
|
1311
|
+
*
|
1312
|
+
* // Retry operation immediately if interrupted by signal.
|
1313
|
+
* if (ec == boost::asio::error::interrupted)
|
1314
|
+
* continue;
|
1315
|
+
*
|
1316
|
+
* // Check if we need to run the operation again.
|
1317
|
+
* if (ec == boost::asio::error::would_block
|
1318
|
+
* || ec == boost::asio::error::try_again)
|
1319
|
+
* {
|
1320
|
+
* // We have to wait for the socket to become ready again.
|
1321
|
+
* sock_.async_write_some(boost::asio::null_buffers(), *this);
|
1322
|
+
* return;
|
1323
|
+
* }
|
1324
|
+
*
|
1325
|
+
* if (ec || n == 0)
|
1326
|
+
* {
|
1327
|
+
* // An error occurred, or we have reached the end of the file.
|
1328
|
+
* // Either way we must exit the loop so we can call the handler.
|
1329
|
+
* break;
|
1330
|
+
* }
|
1331
|
+
*
|
1332
|
+
* // Loop around to try calling sendfile again.
|
1333
|
+
* }
|
1334
|
+
* }
|
1335
|
+
*
|
1336
|
+
* // Pass result back to user's handler.
|
1337
|
+
* handler_(ec, total_bytes_transferred_);
|
1338
|
+
* }
|
1339
|
+
* };
|
1340
|
+
*
|
1341
|
+
* template <typename Handler>
|
1342
|
+
* void async_sendfile(tcp::socket& sock, int fd, Handler h)
|
1343
|
+
* {
|
1344
|
+
* sendfile_op<Handler> op = { sock, fd, h, 0, 0 };
|
1345
|
+
* sock.async_write_some(boost::asio::null_buffers(), op);
|
1346
|
+
* } @endcode
|
1347
|
+
*/
|
1348
|
+
boost::system::error_code native_non_blocking(
|
1349
|
+
bool mode, boost::system::error_code& ec)
|
1350
|
+
{
|
1351
|
+
return this->get_service().native_non_blocking(
|
1352
|
+
this->get_implementation(), mode, ec);
|
1353
|
+
}
|
1354
|
+
|
1355
|
+
/// Get the local endpoint of the socket.
|
1356
|
+
/**
|
1357
|
+
* This function is used to obtain the locally bound endpoint of the socket.
|
1358
|
+
*
|
1359
|
+
* @returns An object that represents the local endpoint of the socket.
|
1360
|
+
*
|
1361
|
+
* @throws boost::system::system_error Thrown on failure.
|
1362
|
+
*
|
1363
|
+
* @par Example
|
1364
|
+
* @code
|
1365
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
1366
|
+
* ...
|
1367
|
+
* boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint();
|
1368
|
+
* @endcode
|
1369
|
+
*/
|
1370
|
+
endpoint_type local_endpoint() const
|
1371
|
+
{
|
1372
|
+
boost::system::error_code ec;
|
1373
|
+
endpoint_type ep = this->get_service().local_endpoint(
|
1374
|
+
this->get_implementation(), ec);
|
1375
|
+
boost::asio::detail::throw_error(ec, "local_endpoint");
|
1376
|
+
return ep;
|
1377
|
+
}
|
1378
|
+
|
1379
|
+
/// Get the local endpoint of the socket.
|
1380
|
+
/**
|
1381
|
+
* This function is used to obtain the locally bound endpoint of the socket.
|
1382
|
+
*
|
1383
|
+
* @param ec Set to indicate what error occurred, if any.
|
1384
|
+
*
|
1385
|
+
* @returns An object that represents the local endpoint of the socket.
|
1386
|
+
* Returns a default-constructed endpoint object if an error occurred.
|
1387
|
+
*
|
1388
|
+
* @par Example
|
1389
|
+
* @code
|
1390
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
1391
|
+
* ...
|
1392
|
+
* boost::system::error_code ec;
|
1393
|
+
* boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(ec);
|
1394
|
+
* if (ec)
|
1395
|
+
* {
|
1396
|
+
* // An error occurred.
|
1397
|
+
* }
|
1398
|
+
* @endcode
|
1399
|
+
*/
|
1400
|
+
endpoint_type local_endpoint(boost::system::error_code& ec) const
|
1401
|
+
{
|
1402
|
+
return this->get_service().local_endpoint(this->get_implementation(), ec);
|
1403
|
+
}
|
1404
|
+
|
1405
|
+
/// Get the remote endpoint of the socket.
|
1406
|
+
/**
|
1407
|
+
* This function is used to obtain the remote endpoint of the socket.
|
1408
|
+
*
|
1409
|
+
* @returns An object that represents the remote endpoint of the socket.
|
1410
|
+
*
|
1411
|
+
* @throws boost::system::system_error Thrown on failure.
|
1412
|
+
*
|
1413
|
+
* @par Example
|
1414
|
+
* @code
|
1415
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
1416
|
+
* ...
|
1417
|
+
* boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint();
|
1418
|
+
* @endcode
|
1419
|
+
*/
|
1420
|
+
endpoint_type remote_endpoint() const
|
1421
|
+
{
|
1422
|
+
boost::system::error_code ec;
|
1423
|
+
endpoint_type ep = this->get_service().remote_endpoint(
|
1424
|
+
this->get_implementation(), ec);
|
1425
|
+
boost::asio::detail::throw_error(ec, "remote_endpoint");
|
1426
|
+
return ep;
|
1427
|
+
}
|
1428
|
+
|
1429
|
+
/// Get the remote endpoint of the socket.
|
1430
|
+
/**
|
1431
|
+
* This function is used to obtain the remote endpoint of the socket.
|
1432
|
+
*
|
1433
|
+
* @param ec Set to indicate what error occurred, if any.
|
1434
|
+
*
|
1435
|
+
* @returns An object that represents the remote endpoint of the socket.
|
1436
|
+
* Returns a default-constructed endpoint object if an error occurred.
|
1437
|
+
*
|
1438
|
+
* @par Example
|
1439
|
+
* @code
|
1440
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
1441
|
+
* ...
|
1442
|
+
* boost::system::error_code ec;
|
1443
|
+
* boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(ec);
|
1444
|
+
* if (ec)
|
1445
|
+
* {
|
1446
|
+
* // An error occurred.
|
1447
|
+
* }
|
1448
|
+
* @endcode
|
1449
|
+
*/
|
1450
|
+
endpoint_type remote_endpoint(boost::system::error_code& ec) const
|
1451
|
+
{
|
1452
|
+
return this->get_service().remote_endpoint(this->get_implementation(), ec);
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
/// Disable sends or receives on the socket.
|
1456
|
+
/**
|
1457
|
+
* This function is used to disable send operations, receive operations, or
|
1458
|
+
* both.
|
1459
|
+
*
|
1460
|
+
* @param what Determines what types of operation will no longer be allowed.
|
1461
|
+
*
|
1462
|
+
* @throws boost::system::system_error Thrown on failure.
|
1463
|
+
*
|
1464
|
+
* @par Example
|
1465
|
+
* Shutting down the send side of the socket:
|
1466
|
+
* @code
|
1467
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
1468
|
+
* ...
|
1469
|
+
* socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send);
|
1470
|
+
* @endcode
|
1471
|
+
*/
|
1472
|
+
void shutdown(shutdown_type what)
|
1473
|
+
{
|
1474
|
+
boost::system::error_code ec;
|
1475
|
+
this->get_service().shutdown(this->get_implementation(), what, ec);
|
1476
|
+
boost::asio::detail::throw_error(ec, "shutdown");
|
1477
|
+
}
|
1478
|
+
|
1479
|
+
/// Disable sends or receives on the socket.
|
1480
|
+
/**
|
1481
|
+
* This function is used to disable send operations, receive operations, or
|
1482
|
+
* both.
|
1483
|
+
*
|
1484
|
+
* @param what Determines what types of operation will no longer be allowed.
|
1485
|
+
*
|
1486
|
+
* @param ec Set to indicate what error occurred, if any.
|
1487
|
+
*
|
1488
|
+
* @par Example
|
1489
|
+
* Shutting down the send side of the socket:
|
1490
|
+
* @code
|
1491
|
+
* boost::asio::ip::tcp::socket socket(io_service);
|
1492
|
+
* ...
|
1493
|
+
* boost::system::error_code ec;
|
1494
|
+
* socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send, ec);
|
1495
|
+
* if (ec)
|
1496
|
+
* {
|
1497
|
+
* // An error occurred.
|
1498
|
+
* }
|
1499
|
+
* @endcode
|
1500
|
+
*/
|
1501
|
+
boost::system::error_code shutdown(shutdown_type what,
|
1502
|
+
boost::system::error_code& ec)
|
1503
|
+
{
|
1504
|
+
return this->get_service().shutdown(this->get_implementation(), what, ec);
|
1505
|
+
}
|
1506
|
+
|
1507
|
+
protected:
|
1508
|
+
/// Protected destructor to prevent deletion through this type.
|
1509
|
+
~basic_socket()
|
1510
|
+
{
|
1511
|
+
}
|
1512
|
+
};
|
1513
|
+
|
1514
|
+
} // namespace asio
|
1515
|
+
} // namespace boost
|
1516
|
+
|
1517
|
+
#include <boost/asio/detail/pop_options.hpp>
|
1518
|
+
|
1519
|
+
#endif // BOOST_ASIO_BASIC_SOCKET_HPP
|